CSS3 DIVs different backgrounds -


I am a CSS3 user, just starting using different web instances, so please forgive me if this question Stupid or very basic (we all have to learn some time!)

I have a simple example DIV and it is styled in such a way:

 . Img1 {width: 206px; Height: 206px; Margin-left: auto; Margin-right: auto; Background: URL (Mom206x206.jpg); }   

Two questions:

1 - This legal syntax is background: url (Mom206x206.jpg) or it should not be accompanied by it Quote: Background: url ("Mom206x206.jpg")

2 - How do I use the same class, but what are the different backgrounds? Or would I have to make a different category for every background in this style?

1.- In the documents it has been said that:

The format of a URI value is followed by the 'url' ('alternative white space' followed by the optional single quote (') or duplicate quotation (')) after the URI itself, optional single bid (') or double quotation (" ) Followed by 'White' after alternate white space).

Then, the following three are valid: 'mother 206x206.jpg') Background: URL ("wax 206x206.jpg")

2.- you can use a square to set the general properties and individual classes for personal background:

  / * general styles * / .img {width: 206px; Height: 206px; Margin-left: auto; Margin-right: auto; } / * Individual styles * / .img.bg1 {background: url (bg1.jpg); } .img.bg2 {background: url (bg2.jpg); } .img.bg3 {background: url (bg3.jpg); } .img.bg4 {background: url (bg4.jpg); } .img.bg5 {background: url (bg5.jpg); }   

Now you can get your HTML like this:

  & lt; Div class = "img bg1" & gt; Div 1 with background page & lt; / Div & gt; & Lt; Div class = "img bg2" & gt; Div with background 2 & lt; / Div & gt; & Lt; Div class = "img bg3" & gt; Div & gt; with background 3 / Div & gt; & Lt; Div class = "img bg4" & gt; Div with background 4; / Div & gt; & Lt; Div class = "img bg5" & gt; Div & gt; with background 5 / Div & gt;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -