Linking the external C.S.S. style sheet to the web page
Create the following markup code in the <head></head> element at the top of your web page.
Enter the name of your external C.S.S. file with a .css extension in the filename.css space:
-
<head> -
<link href="filename.css" media="screen" rel="stylesheet" type="text/css"> -
</head>
This will link the external style sheet to your web document.
- Note:
- The media attribute is given a value of "screen" in this case because I also link an external print style sheet to my web pages.
- If you only have one external style sheet, then set the media attribute with a value of "all", which includes all media-type values.
Creating the C.S.S.
Essential Selectors and their Properties for the Code Block
In order to produce the browser rendered code block we need to create three C.S.S. Rule Sets:
- ol.code
- ol.code pre
- ol.code li
These three presentation layer C.S.S. Rule Sets contain:
- Selectors
- Declaration Blocks
- Declarations
- Property Names
- Property Values
- Property Names
- Declarations
- Declaration Blocks
If you wish, please feel free to experiment and edit any or all of the code shown below in your C.S.S. text editor to achieve your desired style for the code block.
Example C.S.S. text editor style sheet entry:
-
/* start of ol code block style */ -
-
ol.code { -
margin: 2.5em 2em;
-
padding: 0em;
-
border: solid 1px #2b91af;
-
font-family: "Courier New" , Courier, serif;
-
font-weight: bold;
-
color: #2b91af;
-
background: #eee;
-
line-height: 115%;
-
overflow: auto; }
-
-
ol.code pre { -
margin: 0em;
-
padding: 0.3em 0.5em;
-
border-left: solid 1px #2b91af;
-
font-size: 115%;
-
color: #000;
-
background: #eee;
-
width: auto; }
-
-
ol.code li { -
margin: 0em 0em 0em 5em;
-
-
/* end of ol code block style */