FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


HomeWatched TopicsRegisterSearchDirectory
FAQMemberlistUsergroupsLog inStoresItemsBank
Google

Reply to topic Page 1 of 1
CSS Inline
Message  
Reply with quote
Post CSS Inline 
Thus far we have only shown you how to use CSS the way it was meant to be used, separate from the HTML. However, it is possible to place CSS right in the thick of your HTML code and this method of CSS usage is referred to as inline css.

Inline CSS has the highest priority out of external, internal, and inline CSS. This means that you can override styles that are defined in external or internal by using inline CSS. However, inline CSS detracts from the true purpose of CSS, so use it sparingly.

CSS Inline - An HTML Attribute
Believe it or not, CSS is built in to every HTML tag. If you want to add a style inside an HTML element all you have to do is specify the desired CSS properties with the style HTML attribute. Let's add some style to a paragraph tag.

CSS Code:
<p style="background: blue; color: white;">A new background and font color with inline CSS</p>
Display:
A new background and font color with inline CSS

If you have read through the beginning of this CSS tutorial you probably have a good idea of what is going on. Below is the general form for setting Inline CSS in any HTML element.

Pseudo Code:
<htmltag style="cssproperty1: value; cssproperty2: value;"> </htmltag>
The normal rules of CSS apply inside the style attribute. Each CSS statement must be separated with a semicolon ";" and colons appear between the CSS property and its value.

Common Inline CSS Mistakes
When using CSS inline you must be sure not to use quotations within your Inline CSS. If you use quotations the browser will interpret this as the end of your style value. Instead copy our form as we have displayed below.


CSS Code:
<p style="background: url("yellow_rock.gif");">
This is broken</p>

<p style="background: url(yellow_rock.gif);">
This is workin'</p>
Display:
This is broken

This is workin'









http://www.tizag.com/cssT/inline.php

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  



Google

FireFox! The PHP Forum Loans and Credit
Panama Web Design for Hire Free Insurance Quotes!
Web Hosting Advertise Here $10 a Month Designer Children
Never Pay Taxes Again HGH Domain name registration
Web Hosting and Dedicated Servers Insurance Affordable web-hosting


Web Design by PlatinumShore.com & Web Hosting by TradeWebHosting.com