how to code css code example

Example 1: css how to style a

/*a normal, unvisited link*/
a:link{
	color: green;
}
/*a link the user has visited*/
a:visited{
	color: purple;
}
/*a link when the user mouses over it*/
a:hover{
	color: yellow;
}
/*a link the moment it is clicked*/
a:active{
	color: brown;
}

Example 2: css

/* Answer to "css" */

/*
  Cascading Style Sheets (CSS) is a style sheet language used for
  describing the presentation of a document written in a
  markup language like HTML.

  In other words, it's the style of the website.

  For example, the positioning of everything on a website or
  the colour, shape, size of a button. Every design on a
  website is most likely made using css.
*/

Example 3: how to use css

<link rel="stylesheet" href="stylesheet.css">
<div class="mydiv"></div>
<style>
.mydiv {
background-color: /*Color*/;
color: /*Another color*/;
}
</style>

Example 4: css

Use CSS to style websites.

Tags:

Html Example