Jump to content
xisto Community
Sign in to follow this  
iGuest

Basic css code

Recommended Posts

First of all, you don't create websites with CSS, you style websites with CSS.

As for the "basic code", you could tell that using internal CSS style sheets with your HTML documents is through the use of the style element.

This is how you define an internal style sheet in HTML:

<style type="text/css">
...some style info here...
</style>

This is how you define an internal style sheet in XHTML:

<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
...some style info here...
/*<!]]>*/-->
</style>

 

You don't need to learn CSS in a specific order, you learn the properties that you need to use first. Of course you must learn the correct syntax first, which is this:

tagname {property: value}

So if you want to colour paragraphs blue, you would do this:

p {color: blue}
Each pair of properties and values are separated by semicolons.

 

This is basic CSS, there is a lot more out there about CSS, search it for more information.

Share this post


Link to post
Share on other sites

CSS is more commonly used throughout various websites now since it gives the web developer the ability to change attributes of an item globally across various pages. Table website layouts are starting to cease and the use of CSS is now the movement towards the route of web 2.0. CSS is now being supported by various browsers, but as you learn the use of CSS you will learn that each browser renders CSS differently. For example, what renders perfectly in firefox may however end up rendering differently in Internet explorer. Most of the time valid css is rendered perfectly in firefox, but Internet explorer, however, cannot render CSS too well. Certain attributes used in IE can have odd effects. For example, there are certain times issues with the background attribute used in Internet explorer will cause the overlaying object on the background attribute to disappear in internet explorer. This has been an issue with internet explorer and has been discussed ten times over, if you are interested in more information on this odd internet explorer issue just search "dissapearing text in IE with background." The hack that is used to remedy the problem that IE has problems rendering, would be to add the attribute of height equals to 1 percent. This will force IE to display the overlaying element on the background attribute properly. This is one of the many examples of IE bugs that I have came accross as a webdeveloper when building css layouts in IE. Also when you start to go deep into learning CSS you will understand how much the cascading hierarchy is very important, and so you must layout your code in proper coding format, or you will be overwhelmed with CSS issues in big site projects.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.