Results 1 to 5 of 5

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

  1. #1
    Join Date
    May 2011
    Posts
    1,665

    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?

  2. #2
    Join Date
    Apr 2009
    Posts
    569

    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.

  3. #3
    Join Date
    Mar 2010
    Posts
    145

    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.

  4. #4
    Join Date
    May 2009
    Posts
    637

    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

  5. #5
    Join Date
    May 2009
    Posts
    511

    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.

Similar Threads

  1. How to align wd20ears to windows 7
    By KIdaa PaA in forum Hardware Peripherals
    Replies: 5
    Last Post: 24-02-2011, 07:15 PM
  2. how to exit from align screen
    By Koena in forum Portable Devices
    Replies: 4
    Last Post: 10-11-2010, 07:45 AM
  3. Align objects in an Adobe Indesign CS5
    By Bhupathi in forum Windows Software
    Replies: 7
    Last Post: 12-07-2010, 01:11 PM
  4. Web Page not Sitting in Center of Window!
    By warehouse peon in forum Software Development
    Replies: 4
    Last Post: 06-02-2010, 02:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,574,560.78243 seconds with 17 queries