Login | Register | FAQ
Anonymous

hml and css

+ Post a reply

2 posts Page 1 of 1


hml and css

by mangalita » Tue Jul 28, 2015 3:02 pm

I want to center my website. the browser i'm using is firefox, for coding i using Sublime text 3

this is my code for centering.
Inside the <body> tag
<div class="wrap">

</div>
to center the website in css this my code
*{
margin: 0px;
padding: 0px;
list-style-type:none;

for the wrap this the code
.wrap{
width:1000px;
margin: 0 auto;
}

the code is not working. I have tried every thing i'm not able to center. Can some one assist me. I have asked many experts they say nothing is wrong with my code but its not working.. Can someone help
User avatar

mangalita

  • Posts: 1
  • Joined: Tue Jul 28, 2015 2:52 pm

Re: hml and css

by ali_ghomi » Thu Dec 01, 2016 1:38 pm

The "margin: 0 auto" is the best way to do it, you just have to be sure to have the right doctype for it to work. I always use XHTML strict - others will work too. If you don't have a good doctype, the content won't center in IE6

To implement the XHTML strict doctype, put this above your node, as the first line in the page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Best Regards
[url="www.parsaya.com"]طراحی سایت[/url]
User avatar

ali_ghomi

  • Posts: 2
  • Joined: Thu Dec 01, 2016 12:07 pm


+ Post a reply

Page 1 of 1