What's the best way to create multiple backgrounds using HTML5 and CSS and keep markup semantic? -
What is the best way to create multiple backgrounds with HTML 5 and CSS and keep your markup sense? I realize that CSS3 supports many backgrounds, but I also want to use gradients and are interested in how this is practically done - not just its principle.
The traditional approach might be something like this:
& lt; Div class = "background-outer" & gt; & Lt; Div class = "background-internal" & gt; & Lt; Article class = "exit-news" & gt; & Lt; P & gt; We'll talk about some exciting things here & lt; / P & gt; & Lt; / Article & gt; & Lt; Div & gt; & Lt; / Div & gt; I have to do a method that is cross browser friendly and does not include any programmatic work in Javascript or ASP.NET / PHP etc.
This is just More vocabulary can be a case of using class names, but I've been stumped!
Note: Someone may have already answered it but it is difficult to find, if it is a repetition!
It depends on whether it is a private project or a nested device for the customer They do not hurt, they are quick and reliable in all browsers, if it's for someone else, do not talk about shame.
Otherwise, you have to leave the support of some browsers. It's a way to use many backgrounds in CSS. Status: Relative main block, and position: full to : : Fill the elements and set the background on them basically works very well on all the browsers. Edit: A valid code sample for the pseudo-element move I use:
& Lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Title & gt; Test page & lt; / Title & gt; & Lt; Style & gt; Div: first {background: -moz-linear-gradient (top, RGBA (30,87,153,1) 0%, RGBA (125,185,232,0) 100%); / * FF 3.6 + * / Background: -WebKit-Linear-Slope (top, RGBA (30,87,153,1) 0%, RGBA (125,185,232,0) 100%); / * Chrome 10 +, Safari 5.1 + * / div: {background: -moz-linear-gradient (left, RGBA (239, 47, 47,1) 0%, RGBA (125,185,232,0) 100% ); / * FF3.6 + * / Background: -WebKit-Linear-Slope (left, RGBA (239, 47, 47,1) 0%, RGBA (125,185,232,0) 100%); / * Chrome 10+, Safari 5.1 + * / div {background: url (http://www.google.co.uk/images/srpr/logo3w.png); Status: Relative; Margin: 1 AM; Min-height: 10em;} div: After, div: {content: "before"; Status: Completed; Top: 0; Left: 0; Correct: 0; Bottom: 0;} div> * {Status: relative; Z-index: 1} & lt; / Style & gt; & Lt; Div & gt; & Lt; H1 & gt; There are three backgrounds in this div & lt; / H1> & Lt; P & gt; Its contents have to be wrapped, but this is usually not a 'meaning' problem & lt; / Div & gt;
Comments
Post a Comment