Useful Links:
Some Rules of Web Design by Sharpened Products
Creating a Basic Web Page
Element | Code | Result | Try It |
Skeleton: the basic code needed to set up a webpage. It can be created as a text file and saved as .htm or .html |
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>My First Page</h1> </body> </html> |
|
Basic webpage Try It |
Content gets displayed in the body, using tags with p, br, h1-h10, can determine the size and placement of the text |
<!DOCTYPE html> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> |
|
Content Try It |
Color can be added to text and background by using CSS with brackets and RGB or hexadecimal values |
<!DOCTYPE html> <html> <body> <h4 style="background-color:#FF0000"> Background-color set by using #FF0000 </h4> <h4 style="background-color:#00FF00"> Background-color set by using #00FF00 </h4> <h4 style="background-color:#FFFF00"> Background-color set by using #FFFF00 </h4> <h4 style="background-color:#FF00FF"> Background-color set by using #FF00FF </h4> <h4 style="background-color:#00FFFF"> Background-color set by using #00FFFF </h4> </body> </html> |
|
Color Try It |
Images can be inserted, though controlling their placement requires tables or div's |
<!DOCTYPE html> <html> <body> <h2>Spectacular Mountain</h2> <img src="https://upload.wikimedia.org/wikipedia/.jpg" alt="Mountain View" style="width:304px;height:228px;"> </body> </html> |
|
Images Try It |
Links are used to jump to other pages or parts of your site. They are coded with the <a> tag: |
<!DOCTYPE html> <html> <body> <p><a href="http://www.w3schools.com/html/">Visit our HTML tutorial</a></p> </body> </html> |
|
Links Try It |
Creating Rollover buttonw in CSS in HTML document head: should have style brackets |
.cssbutton { position: relative; font-family: Tahoma, Georgia, sans-serif, helvetica, arial; background: url(roll/over.jpg) no-repeat; white-space: nowrap; display: block; width: 100px; height: 28px; margin: 0 0 2px 0; padding: 0; } .cssbutton a { display: block; color: #000000; font-size: 12px; font-weight: bold; text-align: center; width: 100px; height: 28px; display: block; float: left; color: #ffffff; text-decoration: none; } .cssbutton img { width: 100px; height: 28px; border: 0 } * html a:hover { visibility:visible } .cssbutton a:hover img { visibility:hidden } .cssbutton span { position: absolute; left: 5px; top: 5px; margin: 0px; padding: 0px; cursor: pointer; } |
Place this where CSS menu will appear
<div class="cssbutton"> <a href="index.html"><img src="roll/down.jpg" alt="Home" /><span>Home</span></a> </div> <div class="cssbutton"> <a href="menubar.html"><img src="roll/down.jpg" alt="Menu Bar" /><span>Menu Bar</span></a> </div> <div class="cssbutton"> <a href="competition.html"><img src="roll/down.jpg" alt="Competition" /><span>Competition</span></a> </div> <div class="cssbutton"> <a href="links.html"><img src="roll/down.jpg" alt="Links" /><span>Links</span></a> </div> |
Link to Freebits rollover code sample |
Text Editor web page: create your own
Open Trinket HTML lesson page on your computer. Open a new file. Copy and paste, or, better yet, copy and type the code from the Skeleton code box of the table above. Save it.to your desktop as index.html. In Notepad++, hit Run, and launch in Chrome. Remember, the < and /> tags are needed on either side of your content, and the preferred format calls for indenting each subsequent element. You can add color and font styles, etc. in the head portion of the page, or link to a separate CSS file with the following code in the head of the page: <link rel="stylesheet" type="text/css" href="style.css"> . You can layout your webpage design on paper or use this online gridpaper