Interview Questions

what CSS is, why not start coding??

CSS Interview Questions and Questions


(Continued from previous question...)

27. what CSS is, why not start coding??

CSS is sort of like scripting language made for the web. In contrary with HTML, DHTML, JavaScript, VBScript and many others. CSS is strictly for formatting your web-page and now many new browser support it. (NOTE: Older browser do not support CSS, so please check your browser version and make sure whether it supports it or not. You may have to update your current Browser.)

The way the code goes into your Web-page is through a variety of ways. The way CSS works is that is the code is set between the<head></head> tags. You can put the CSS code after </title> which is what most people do. Now, here are the following ways of making your webpage with CSS enabled features:

1.) Writing your CSS code within your HTML source code. This is how it would look like:

<html><head><title>My First CSS!</title>
<!-- Now begin the CSS coding! -->
<STYLE TYPE = "text/css">
<!--
body {
background-color: #eeeee;
}
p {
text-align: left;
color: black;
font: Verdana;
font-size: 80%;
}
a {
text-decoration: none;
color: black;
font-weight: bold;
}
a:hover {
text-decoration: underline;
color: red;
font-weight: bold;
}
-->
</STYLE>
<!-- End CSS code -->
</head><body></body></html>

2.) Linking to your CSS file. This tells the webpage to find the .css file and use it as the CSS code. Here is the code that would allow you to do:

<html><head><title>CSS</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head><body /></html>

As you can see from the code above, the <link> tag is pretty helpful. What it does is that it links to the style.css file which has all the css code. Just like embedding an image throught he <img> tag.

Now to explain a bit from the first example. CSS code isn't very hard to understand.Take for example the body { ..} part. What it does is that it formats how the <body> tag in HTML would work. That is a very simple way of formatting the body tag with the CSS. To help you understand better, here is a simple syntax for CSS:

selector { property1: value1; property2: value2;}

The "selector" sort of relates to the html tags used for outputting etc...

We all know that <a> is a tag used for links. You will see in the example about a:hover and a itself. <br>What a does it just sets the characteristics of the format. You can set how you want a link to appear using the font size, weight etc..

Then comes the "a:hover". What does is also pretty self explanatory. It acts on when a person moves the mouse cursor over the links.

ADVANCED CSS FEATURES:

CSS can be even used to change the appearance of the scroll bar at your right side. Unfortunately, that only works with IE. You have to be using IE in order for this to work. Here is how to change some appearances of your scroll bar:

The CSS statements for doing this are:
1) scrollbar-3dlight-color
2)scrollbar-arrow-color
3) scrollbar-base-color
4) scrollbar-dark shadow-color
5) scrollbar-face-color
6) scrollbar-highlight-color
7) scrollbar-shadow-color
8) scrollbar-track-color

<style type="text/css">
<!--
BODY {
scrollbar-arrow-color: green;
scrollbar-face-color: #FFFFFF;
scrollbar-track-color: rgb(12,35,244);
}
// -->
</style>

How to customize your textboxes.
Here is the code on how to do it:

<style type="text/css">
<!--
BODY {
scrollbar-arrow-color: green;
scrollbar-face-color: #FFFFFF;
scrollbar-track-color: rgb(12,35,244);
}
TEXTAREA {
scrollbar-arrow-color: green;
scrollbar-face-color: #FFFFFF;
scrollbar-track-color: rgb(12,35,244);
}
// -->
</style>

That above code, has some similarities. The textbox area is treated with the same function statements as for the scrollbar. The scrollbar statements goes in the BODY selector.

(Continued on next question...)

Other Interview Questions