Zaloguj | Zarejestruj | FAQ
Anonymous

hml and css

+ Odpowiedz

Posty: 2 Strona 1 z 1


hml and css

przez mangalita » Wt lip 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
Avatar użytkownika

mangalita

  • Posty: 1
  • Dołączył(a): Wt lip 28, 2015 2:52 pm

Re: hml and css

przez ali_ghomi » Cz gru 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]
Avatar użytkownika

ali_ghomi

  • Posty: 2
  • Dołączył(a): Cz gru 01, 2016 12:07 pm


+ Odpowiedz

Strona 1 z 1