登录 | 注册 | FAQ
Anonymous

hml and css

+ 发表回复

2 篇帖子 分页: 1 / 1


hml and css

mangalita » 周二 7月 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
头像

mangalita

  • 帖子: 1
  • 注册: 周二 7月 28, 2015 2:52 pm

Re: hml and css

ali_ghomi » 周四 12月 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]
头像

ali_ghomi

  • 帖子: 2
  • 注册: 周四 12月 01, 2016 12:07 pm


+ 发表回复

分页: 1 / 1