HTML/CSS/Style Basics/url

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

background-image using the url function, which takes the URL of a file as its only parameter

   <source lang="html4strict">

.

<html> <head> <title>Set URL for Background Image </title>

   <style type="text/css">
       div { background:url("http://www.wbex.ru/style/logo.png") no-repeat; width:250px; height:76px; } 
   </style>

</head> <body>

Background Image

</body> </html>

</source>
   
  


list-style-image: url("collapsed_folder.gif");

   <source lang="html4strict">

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

   <head>
       <title></title>
       <style type="text/css">
           li {
               list-style-image: url("collapsed_folder.gif");
           }
           li + li + li + li + li {
               list-style: inside url("exploded_folder.gif");   
           }
       </style>
   </head>
   <body>
  • My Pictures
  • My Music
  • My Documents
  • My Computer
  • Control Panel
   </body>

</html>

</source>
   
  


you only have to put a URL in quotes if the URL contains whitespace.

   <source lang="html4strict">

<html> <head> <title>Set URL for Background Image </title>

   <style type="text/css">
       div { background:url("your file name.png") no-repeat; width:250px; height:76px; } 
   </style>

</head> <body>

Background Image

</body> </html>

</source>