Styling can be applied by using:

  • External CSS style sheet . Preferred method!
  • Internal CSS style sheet, using the <style> element in the head section of the document
  • Inline style attribute
  • Scripting



External Style Sheet


Using a <link> tag in the head section of the document:

	<link rel="stylesheet" type="text/css" href="style.css">



Internal Style Sheet


Defined in the <head> section of the document, using the <style> element:

	<style type="text/css">
		body {background-color:#000000;}
		p {color:#0000ff;}



Inline styling


Defined by applying the style attribute within an element, e.g.


<p style="color: blue; font-size: 2em;">My text goes here.</p>


Will render asĀ My text goes here.


Leave a Reply