FAQ about web standards _ experience exchange

Source: Internet
Author: User
Web Standard FAQ set 5 19. Why cannot this background color be displayed?

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <style type =" text/css "> <! -- Ul {background: red} li {float: left; width: 180px ;} --> </style> <ul> <li> web Standard FAQ </li> <li> web Standard FAQ daquan </li> <li> FAQ about web standards </li> <p style = "clear: both "> </p> </ul>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


In IE, the ul with a background color is not displayed, This Is A haslayout problem, the solution is also a lot of reference: http://bbs.blueidea.com/viewthread.php? Tid = 2636904
20. How can I display layers on top of FLASH?

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <style type =" text/css "> <! -- P {position: absolute; top: 20px; left: 20px; width: 200px; height: 200px; background: red} object {width: 500px; height: 100px ;} --> </style> <p> FAQs about web Standards web standards FAQs standard FAQ Daquan web Standard FAQs </p> <object type = "application/x-shockwave-flash" data = "http://gg.blueidea.com/2005/www/m533-104.swf"> <param name = "movie" value = "http://gg.blueidea.com/2005/www/m533-104.swf"/> </object>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


The solution is to make FLASH transparent.
21. How to center a layer vertically in the browser

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <style type =" text/css "> <! -- P {position: absolute; top: 50%; left: 50%; margin:-100px 0 0-100px; width: 200px; height: 200px; border: 1px solid red ;} --> </style> <p> web Standard FAQ </p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


Here we use the absolute percentage position, and the method of negative value of the external patch, the negative value is its own width and height divided by two
22. The image is perpendicular to the container

The Code is as follows:


Reference: http://bbs.blueidea.com/thread-2666987-1-1.html


23. How to arrange the three columns horizontally

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <style> p {float: left; margin: 1px; width: 200px; height: 200px; background: orange} </style> <p> </p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <style> p {position: absolute; top: 50%; left: 50%; margin:-100px 0 0-300px ;}</style> <p style = "background: #404040; width: 200px; height: 200px; "> 1 </p> <p style =" background: # FD7C03; width: 200px; height: 200px; margin:-100px 0 0-100px; "> 2 </p> <p style =" background: # eee; width: 200px; height: 200px; margin:-100px 0 0 100px; "> 3 </p>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Strict // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <style> span {margin: 1px; display:-moz-inline-box; display: inline-block; width: 300px; height: 200px; background: orange;} </style>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]


You can use float: left or Inline to arrange the DIV horizontally. You can also absolutely locate the object.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.