CSS is used to style HTML elements.
Look! Styles and colorsThis text is 30 pixels high |
Styling HTML with CSS
CSS was introduced with HTML 4, to provide a common way to style HTML elements.
CSS styling can be added to HTML in the following ways
- in separate style sheet files (CSS files)
- in the style element in the HTML head section
- in the style attribute in single HTML elements.
Using the HTML Style Attribute
It is time consuming and not very practical to style HTML elements using the style attribute.
The preferred way to add CSS to HTML, is to put CSS syntax in separate CSS files.
However, in this HTML tutorial we will introduce you to CSS using the style attribute. This is done to simplify the examples. It also makes it easier for you to edit the code and try it yourself.
You can learn everything about styles and CSS in our
HTML Style Example - Background Color
The background-color property defines the background color for an element:
Example
|
The style attribute makes the "old" bgcolor attribute obsolete.
HTML Style Example - Font, Color and Size
The font-family, color, and font-size properties defines the font, color, and size of the text in an element:
Example
|
The style attribute makes the old <font> tag obsolete.
HTML Style Example - Text Alignment
The text-align property specifies the horizontal alignment of text in an element:
Example
|
The style attribute makes the old "align" attribute obsolete.
Deprecated Tags and Attributes
In HTML 4, several tags and attributes are deprecated. Deprecated means that they will not be supported in future versions of HTML and XHTML.
The message is clear: Avoid using deprecated tags and attributes!
These tags and attributes should be avoided:
Tags | Description |
---|---|
<center> | Deprecated. Defines centered content |
<font> and <basefont> | Deprecated. Defines HTML fonts |
<s> and <strike> | Deprecated. Defines strikethrough text |
<u> | Deprecated. Defines underlined text |
Attributes | Description |
align | Deprecated. Defines the alignment of text |
bgcolor | Deprecated. Defines the background color |
color | Deprecated. Defines the text color |
For all of the above: Use styles instead!
honest hackerz
video
Labels
- antivirus an internet security
- BACKUP AND RECOVERY TOOLS
- BASIC TRICKS OF PC HACKING
- Best Spywares
- BLACK BERRY
- BLOGGER TIPS
- Change Your Ip adress
- Check Online that how many Sims are against your CNIC.
- COLLAGE SERVER HACKING
- COMPUTER HACKING
- COMPUTER PLAYERS
- COMPUTER SOFTWARES
- COOKIES STEALING
- COOL TIPS
- Cracking Kit 2012
- crypters and binders
- E BOOK TUTORIALS
- E MAIL AND SMS BOMBER
- FACEBOOK HACKING
- FACEBOOK SKINS
- File Sonic premium account
- Get someones ISP password
- GRAPHICS
- HACK PASSWARDS
- HACK ADMIN PASSWARD
- Hack Any Facebook Account
- Hack Computer using ip Adress
- HACK PC BY DORK
- HACK PREMIUM ACCOUNTS
- HACKED EMAIL RECOVERY
- HACKING
- HOT FILE PREMIUM ACCOUNTS
- How To Recover Deleted File
- IP TRACING
- IPHONE SOFTARES
- JAZZ
- LATEST
- LATEST I PHONES
- LEARN BASIC HTML
- Make Mozilla 10x Times Faster
- MOBILE AT
- MOBILE PRICES
- MOBILE SOFTWARES
- NOKIA
- Nokia Secret Code's
- NOKIA SOFTARES
- Operate Firefox faster
- ORKUT HACKING
- PACKAGES
- PC HACK
- PC PROTECTION
- Q MOBILES
- Remove Bios Password
- Reset Windows Password
- Restore Firefox Passwords
- SAMSUNG
- See passwords behind stars
- Speed Up Your Bandwidth By 30%
- Stealth Crypter V3 Private
- SUPER FAST BROWSING
- Transfer your Photos to pencil sketch
- VIDEO EDITING
- VIRUSES
- WEBSITE HACKING
- WINDOWS 7 HACK
- Windows XP Secrets
- wireless hacking
sponsers
Blog Archive
-
▼
2011
-
▼
May
-
▼
May 10
- BASIC HTML CH # 1
- BASIC HTML CH # 2
- BASIC HTML CH # 3
- BASIC HTML CH # 4
- BASIC HTML CH # 5
- BASIC HTML CH # 6
- BASIC HTML CH # 7
- BASIC HTML CH # 8
- BASIC HTML CH # 8
- BASIC HTML CH # 9
- BASIC HTML CH # 9
- Headings are important in HTML documents.HTML Hea...
- BASIC HTML CH # 10
- BASIC HTML CH # 11
- BASIC HTML CH # 12
- BASIC HTML CH # 13
- BASIC HTML CH # 14
- BASIC HTML CH # 14
- BASIC HTML CH # 14
- BASIC HTML CH # 14
- BASIC HTML CH # 14
- BASIC HTML CH # 19
- BASIC HTML CH # 15
- BASIC HTML CH # 16
- BASIC HTML CH # 16
- BASIC HTML CH # 17
- BASIC HTML CH # 18
-
▼
May 10
-
▼
May