HTML/CSS/Style Basics/Tag Selector

Материал из Web эксперт
Перейти к: навигация, поиск

img in a div

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"> <head>

 <title></title>

<style type="text/css"> div img {

display: none;

} </style> </head> <body>

header 1!

<img src="http://www.wbex.ru/style/logo.png" alt=" " />

header 2

</body> </html>

</source>
   
  


nested tag style

   <source lang="html4strict">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">

   <head>
       <title></title>

<style type="text/css"> body {

 margin: 10%;

} h1 {

 width: 216px;
 height: 72px;
 position: relative: 

} h1 span {

 background: url(replacementimage.jpg) no-repeat;
 position: absolute;
 width: 100%;
 height: 100%;

} </style>

   </head>
   <body>

spanheader

   </body>

</html>

</source>