![]() |
|
Add Style Sheets to Your WebsiteCSS or Cascading Style Sheets are the best invention since sliced bread as far as web pages are concerned. You can control the entire appearance of a web page using CSS. There are three ways that you can add style sheets or style settings to your code. You can use embedded sheets which are placed in the head section of the document. You can use inline style sheets which are placed in the tags of the page. You can use linked style sheets which are created on a separate page and attached using a statement in the head section of the document. You can also use all 3 types on the same page. We're going to develop this site using a linked style sheet. Style sheets can be created using a simple text editor. Save the page in your htdocs folder as stylesheet.css. The .css extension is critical. Now open your web page, firstpage.html and paste this code between the open and close head tags: Save the changes and look at your page in a browser. Note: If you didn't close the browser, right click on the web page and click Reload or Refresh. Your web page code without the Doctype now looks like this:
If you don't have a green screen, check your css file and make sure you saved it with a css extension in the htdocs folder. You'll need to use the 'All Files' filter on the text editor to see the file in the folder. Also be sure you spelled the name right. Did you skip a step? If you still see a white screen one or both of the pages may not have been saved in the htdocs folder. Web pages and style sheets must be located in the same folder or a proper path to the style sheet must be added to the linking code. Look at the style sheet code. We'll being adding more settings as we go along. The entries will be in the same format. Name the element or HTML tag and then place the settings between a set of curly brackets. Each individual setting is followed by a semi-colon. We added settings for margin , padding and the default colors of our web page. Tip: When you add the next entry to the style sheet, create a little space between the entries using the Enter or Return key. It will make it much easier to read when you start making changes to it.
If you've looked at the page in a browser and you have a blank green screen, you're ready to learn more about Color Free Business Web HostingIf you are building a website for a business or organization, you can put it online for free at Microsoft® Office Live Small Business. You can create your website with HTML and upload it or use their tools and build it online. Take your business online with Microsoft® Office Live Small Business. Get started for FREE!
Create Web Sites without Learning Code
|
HTML Tutor HTML Editors Online Builder Tutorials Other Helps |
|
www.createasite.net ©2008 All Rights Reserved - Create a Site with HTML - Make a Free Website |