HTML Styles - CSS
Styling HTML with CSS
CSS stands for Cascading Style Sheets.
CSS describes how HTML elements are to
be displayed on screen, paper, or in other media.
CSS saves a lot of work. It can control the layout of multiple web
pages all at once.
CSS can be added to HTML
elements in 3 ways:
- Inline - by using the style attribute in HTML elements
- Internal - by using a <style> element in the
<head> section
- External - by using an external CSS file
The most common way to
add CSS, is to keep the styles in separate CSS files. However, here we will use
inline and internal styling, because this is easier to demonstrate, and easier
for you to try it yourself
Inline CSS Code:
Internal CSS Code:
External CSS Code:
CSS Fonts Code:
CSS Border Code:
CSS Padding Code:
CSS Margin Code:
The id Attribute Code:
The class Attribute Code:
External References Code:
You can edit the HTML, Copy the Code areas HTML code to Paste our online HTML editor Page Or below HTML Editor area Now Practice
Chapter Summary
- Use the HTML style attribute for inline styling
- Use the HTML <style> element to define internal CSS
- Use the HTML <link> element to refer to an external CSS file
- Use the HTML <head> element to store <style> and <link>
elements
- Use the CSS color property for text colors
- Use the CSS font-family property for text fonts
- Use the CSS font-size property for text sizes
- Use the CSS border property for borders
- Use the CSS padding property for space inside the border
- Use the CSS margin property for space outside the border
0 comments:
Post a Comment