Lunarpages Internet Solutions Blog
  • Home
  • About Us
  • LunarForums
  • Free Web Tools
  • Free WP Themes
0

Basics of CSS in Web Design

25 September, 2009 - Design, Mitch Keeler

Adding a Cascading Style Sheet to your current web site layout and save you time and make your web site look a lot more professional in the process.  Cascading Style Sheets, or sometimes referred to as CSS, is a style sheet language used to describe how a web page should be formatted.

For example, if you wanted to make some text on a web page look bold, you might use this snippet of HTML code:

<strong>this will be some bold text!</strong>

Which seems simple enough.  However, what if you want to chance the color, font, and how this text is shown in that spot across all of your web pages?  Well then your HTML in your pages becomes a rambling mess.  That is where Cascading Style Sheets come in handy.

Cascading Style Sheets allow you to, in a much more organized way, sort out how your web site design looks in a totally separate file, or chunk of code in between the head tags.    For example, let say you wanted the title of your page to be bold, green, and a different font style than the rest of the page.  In your HTML code, you would use something like this:

<p class="mycooltitle">this is my page title</p>

That tells the browser that everything within this paragraph or <p></p> tags will follow the design setup class I have defined as “mycooltitle”.  Now, in between the head tags (<head> </head>) I want you to add this:

<style type="text/css">
    .mycooltitle {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-weight: bold;
        color: #336633;
    }
</style>

This CSS code tells the web browser to apply these design settings to the class marked, “mycooltitle”.  It does three things.  It says it will use the Verdana font, the font will be bolded, and it will be colored green (#336633 is the HTML color code for a shade of green).

That is how you apply Cascading Style Sheets to your web design and layout of your own web pages.  One of the major benefits of using CSS is that it helps to separate your web site code with your design.  This way, you can change one aspect very easily in the CSS file (when or if you start to master external style sheets).  I’ll save that lesson for another day.

Archives

Categories

View more:

  • About the Lunarpages blog
  • Best Blog Hosting Guide
  • BOTW.org 40% Discount
  • Contact Lunarpages
  • Free Online Tools
  • Free Webmaster Downloads
  • Free Wordpress Themes

Best Web Hosting

Lunarpages.com Web Hosting

Recent Posts

  • Customer Showcase – SportVision
  • 5 Mobile App Trends for 2012
  • 10 Technology Trends for 2012
  • 5 Open Source CMS for Websites
  • Google Will Change Your Web Marketing in 2012

Recent Comments

  • Anonymous on 10 Best Google AdSense WordPress Plugins
  • best seo forums on 5 Reasons Why VPS Hosting May Be the Solution You’ve Been Searching For
  • Roger on 5 Mobile App Trends for 2012
  • Web Hosting Reviews on 2012 Resolutions Promotion
  • Graham Gillen on Plesk 9.5.2 Backup Tutorial

@Lunarpages Feed

Who We Are

  • Web Hosting Services
  • About us
  • Partners
  • Affiliate Program
  • Specials
  • 24/7/365 Support Desk
  • Community Forum
  • WIKI

Our Products

  • Colocation Services
  • Fully Managed Services
  • Dedicated Hosting
  • VPS Hosting
  • Microsoft Exchange
  • Open-Xchange
  • Fax To Email
  • Linux Hosting
  • Windows Hosting
  • Reseller Hosting
  • Quicksite Website Builder
  • SEO & SEM Services
  • Payment Processing
  • SecureLive Website Security
  • Tremendesk - Help Desk Solution

Connect With Us

Stay in touch with us!

Sign up for our monthly newsletter to receive updates, news, and current promotions!

Twitter
Facebook Google+ RSS Feed


© 2000 - 2011 Add2Net, Inc. "Lunarpages", "Add2Net" and the "Lunar Symbol" are the trademarks or the Registered trademarks of Add2Net, Inc.
All rights reserved. Unauthorized use is prohibited.