Thursday, February 23, 2012

CSS Basics - Applying CSS to HTML - @importing Stylesheets


There is one more way of importing external style sheets into HTML files and that is the @import property. The syntax look as given below:

<style type="text/css" media="screen">
@import url("styles.css");

...other import statements or CSS styles could go here...
</style>

Sometimes important statements can be seen without the brackets but it does the same thing. One should also be aware that @import should always be first in an embedded style sheet. And you can specify that the imported style sheet is applied only to certain types of media and that is done by including the media type at the concluding part of the imported statement. However, this works in every browser except IE6 and below.

The code given below does the same thing as the previous example:

<style type="text/css">
@import url("styles.css") screen;

...other import statements or CSS styles could go here...
</style>

These are the ways you can import CSS to a HTML document. You may however be careful in choosing the styles you would go with.

Visit back, there are more posts coming up about Cascading Style Sheets i.e. CSS and XHTML.

6 comments:

Software Development Services said...

your creation will be useful for many generation to come. great job.

wilsonmars said...

thanks for posting this how we are using external css.

webdesign said...
This comment has been removed by the author.
Gary Cantrell said...

There is noticeably a bundle to know about this. I assume you made certain nice points in features also.

anna harris said...

This post is useful and needful for my website designing. It is basic css to apply in html and we can create a gorgeous websites to using css.

serviced apartments bangalore said...

Princess Square in Koramangala - Serviced Apartments in Bangalore

With over 40 years of experience in the Service Industry all of us at princess square Service Apartments personally know caring for the guest and It is our goal to make sure you, your family and friends the guest enjoy a carefree vacation or Superior business class experience.

We have a small quality driven collection of hotels & hotel apartments within one of the world's most modern and fastest growing city of Bangalore.

Welcome to the Garden city - Welcome to Princess square Service Apartments Hospitality, where our promise of pure value, pure quality and pure service is delivered.

An essential attribute of all our properties are our convenience and central locations within the city of Bangalore.

At princess square Service Apartments we provide a wonderful choice. Whether you are a discerning budget traveler or just looking for that element of luxury of a 5 star business hotel, we have the accommodation solution to suite you.

Our deluxe hotel apartments offer a choice of both full hotel service operations as well as self catering facilities. We have an extensive choice of accommodations to choose from and our portfolio includes standard hotel rooms, deluxe hotel suites, studios, One, Two & Three Bedroom suite apartments, Royal Suites, Executive & Privilege Floors.

We are ideal for leisure, corporate travelers, stopovers & long stays.

All our hospitality establishments provide only the highest levels of comfortable quality accommodations and we are the perfect choice for your next city break, business meeting or special family occasion.

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | JCPenney Coupons