Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Align the div tag in center in asp.net web page?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-06-2011
Member
 
Join Date: May 2011
Posts: 1,658
Align the div tag in center in asp.net web page?
  

Hello friend, I am new to this website development in asp.net I am trying to learn it by making a website for myself as an example the problem with me is I have a div tag with some contents in it when I am double clicking on it or dragging it to a designing page from the tool box it is starting from the left margin of the design page and I want that div tag to be in center pleas and don?t want to use table I for it anyone tell me how can I do that?

Reply With Quote
  #2  
Old 09-06-2011
Member
 
Join Date: Apr 2009
Posts: 567
Re: Align the div tag in center in asp.net web page?

OK friend as you said you are a beginner to this asp.net I would like to suggest you that you can?t try to do this by making the div tags position as an absolute (position: absolute) this may sort your problem out you can do this by coding or even manually from the tool bar selecting the position tab and then selecting absolute to it this may solve your problem out there are many ways to do it out but if you are a beginner I think you have to try this one out first.
Reply With Quote
  #3  
Old 09-06-2011
Member
 
Join Date: Mar 2010
Posts: 144
Re: Align the div tag in center in asp.net web page?

I am a beginner to and as you said you are making an example website for yourself am doing the same procedure to learn what I have been taught and some days ago I to was going through the same problem but I found out that there is a very simple way to solve this problem out that is just by selecting that tag and holding your cursor on its left margin you would be able to see the dragging cursor by which you can just drag that tag away from your left margin and it is damn simple I am using this and dint had any problem till now you must try it out to hope you get it done to.
Reply With Quote
  #4  
Old 09-06-2011
Member
 
Join Date: May 2009
Posts: 620
Re: Align the div tag in center in asp.net web page?

Well friend by my personal view I would like to tell you that every developer has a beginning time and during this period you have to sharp your developing skill because whatever you are doing at this time basically you get used to all those techniques And I think that every beginner should use a coding procedure instead of using shortcuts. If even you are using a shortcuts to get your work done what use must do is go through with the automatically generated coding in the coding page so in this case when you are dragging the div tag away from the left margin or any margin it?s actually a code been processed of alignment which is margin-left you can give the value either in percentage or in pixels
Code:
<div style =?margin-left: 50px ;?> or <div align=?center?> would work to
Reply With Quote
  #5  
Old 09-06-2011
Member
 
Join Date: May 2009
Posts: 503
Re: Align the div tag in center in asp.net web page?

Hey, why don?t you use CSS for it you can use any one of the three CSS either declare the values is may CSS file which is in .xml format by using class or declare it in title tag or declare it directly to that div tag which you want to move to center . Here is some coding which you can edit them according to your example
Code:
<div style="color: #00FF00; align: center">
  <h3>this is a header</h3>
  <p>this is a paragraph. </p>
</div>
This is an inline CSS directly to that div tag.
Make and .Xml file for your CSS and then
Code:
.div1 
{
Align: center;
} 
And then in your coding page 
<Head>
<link rel="style sheet" type="text/CSS" href="mystyle.css" />
</head>
And then  
<div class=?div1?>
Hope is solves your problem.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Align the div tag in center in asp.net web page?"
Thread Thread Starter Forum Replies Last Post
How to align wd20ears to windows 7 KIdaa PaA Hardware Peripherals 5 24-02-2011 07:15 PM
how to exit from align screen Koena Portable Devices 4 10-11-2010 07:45 AM
Align objects in an Adobe Indesign CS5 Bhupathi Windows Software 7 12-07-2010 01:11 PM
Web Page not Sitting in Center of Window! warehouse peon Software Development 4 06-02-2010 02:55 AM


All times are GMT +5.5. The time now is 07:50 PM.