css notes - edl€¦ · css notes november 30, 2016 css notes css stands for cascading style...

4
CSS Notes November 30, 2016 CSS Notes CSS stands for Cascading Style Sheets. 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 HTML Background Color Inline <html> <head> </head> <body style="backgroundcolor:powderblue;"> </body> </html> Internal <head> <style> body{ backgroundcolor: powderblue; } </style> </head>

Upload: vantu

Post on 20-Apr-2018

216 views

Category:

Documents


3 download

TRANSCRIPT

CSS Notes November 30, 2016

CSS NotesCSS stands for Cascading Style Sheets.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

HTML Background Color

Inline<html><head></head><body style="background­color:powderblue;"></body></html>

Internal

<head><style>bodybackground­color: powderblue;</style></head>

CSS Notes November 30, 2016

HTML Text Color Inline

<body ><h1 style="color:blue;"> heading</h1><p style="color:red;">Paragraph.</p></body>

Internal<head><title> Hello</title><style>

h1color: blue;p color: red;

</style></head>

HTML FontsInline

<body ><h1 style="font­family:algerian;"> heading</h1><p style="font­family:arial;">Paragraph.</p></body>

Internal<head><style>

h1font­family:algerian;

p

font­family:arial;

</style></head>

CSS Notes November 30, 2016

HTML Text Size

Inline

<body ><h1 style="font­size:100;"> heading</h1><p style="font­size:50;">Paragraph.</p></body>

Internal<head><style>

h1font­size:100;

p

font­size:100;

</style></head>

HTML Text Alignment

Inline

<body ><h1 style="text­align:center;"> heading</h1><p style="text­align:center;">Paragraph.</p></body>

Internal<head><style>

h1text­align:center;

p

text­align:center;

</style></head>

CSS Notes November 30, 2016