Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2010
    Thanked 0 Times in 0 Posts

    Issue with ASP.NET and CSS (layout isn't centered)

    I'm having a problem with an ASP.net website and CSS.

    I've pasted my CSS code from a previous website (HTML and CSS) to have a look at it.
    I've copied the basic divs etc into the masterpage.

    But I'm finding that the layout isn't centered. The layout would normally be centered with a border but now it's actually positioned left. I've tried this with a few different stylesheets I had and I'm having the same problem.

    Is there something special that needs to be done for ASP.net?

    Any help would be appreciated!


  2. #2
    New Coder
    Join Date
    Mar 2010
    Thanked 0 Times in 0 Posts
    That sounds like a CSS issue. Do you have some code for us to look at?

    In the CSS, try setting your main container div to margin: 0 auto 0 auto;

    That will detect left and right margins and set them to be equal widths. This will center the div to the screen. Circumstances can change this however, but it's a good place to start.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts