Alright, I just started trying to do some CSS (I know, I have too much time on my hands) in order to make my own theme for firefox, so it matches my windows theme a little better.

However, I really don't know what CSS is, what the general syntax is, and would love a decent list of regularly-used commands. So, could you guys help me?

(more specific questions, cause we all like it better that way XD)
What is CSS and what is it most commonly used for?
How does the general syntax work? Equivalent expressions in HTML and C++ and BASIC work fine for me.
Could I get a short list of commonly-used commands, and their regular syntax?

Thanks a ton, everyone!

Member Avatar for GreenDay2001

CSS which stand for cascading style sheets is used as an extension to HTML. These generally defines how to display the html tags, i mean to say its background color, foreground color, dimensions, postions etc...
For the most it prerequisite for building a good site, since it offers so many features and you cant create a good attracting page just using HTML(which is a foundation for building page).

i hope and assume that u r clear with ID's, CLASS's, ELEMENT's and ATTRIBUTE's.

you basic syntax is

element
{
  statemen 1;
  statement 2;
  -----
  --------------
  statement n;
}

or

.class
{
   statemen 1;
   statement 2;
   -----
   --------------
   statement n;
 }

or

#id
{
   statemen 1;
   statement 2;
   -----
   --------------
   statement n;
 }

or mix em all together

element.class
{
   statemen 1;
   statement 2;
   -----
   --------------
   statement n;
 }

element #id
{
   statemen 1;
   statement 2;
   -----
   --------------
   statement n;
 }

and if you want equivalent expressions for C++ , HTML or whatever, i can't help you since u cant compare a stylesheet eith c++. however there are certain thing in CSS which could be done through HTML also such as font-family/font-size/color etc...

some commonly used CSS properties are
margin, padding, display, background, background-image, color, font-family, font-size, border, text-decoration etc... infact every css property is important and helpful :) .

you can go to http://w3schools.com/css/default.asp for a good CSS tutorial.

vishesh

Hi

Not sure if you have sorted this out yet, but thought I would drop you a line in case you are still in need of info on CSS.

In the first instance I would go to the following site www.w3.org and click the link to CSS in the column on the left hand side. You should find all you need to know here.

CSS is a very powerful way to control and maintain the appearance of your website. It is intended to separate the design/layout/appearance of the pages from the content. That is, use html to enter content and use (preferably external) style sheets to manipulate the colour, size, positions, etc. This way, if you suddenly decide to change the colour of all the title texts on all of you web pages, you can do this with one single alteration to a style sheet, rather than multiple (not to mention laborious) changes to each web page.

For example if in your style sheet you set up the following:

p.title

sorry ... accidentally posted before completing all the example. If you want me to finish, just let me know.

NB. One other point. Be aware that you can link more than one external css sheet to a given web page, that way to simplify maintenance, if certain colours, layouts, etc are specific to one or two pages but not all, you can keep this information in its own style sheet and link more than one style sheet to the page. Hope this helps.

it is a very, very easy language I started learning it yesterday for 3 hours and I am already used to it.
Say you wanted to make all <P> tags a red colour, arial font and size 4 you would enter this in the head . . .

<HEAD><STYLE TYPE="CSS">
P
{
text-size: 4;
color: red;
font-family: arial;
}
</STYLE></HEAD>

it is fairly simple, you then do this in the html body <P>Hello this will be red, arial size 4 text</P> hope i helped!!

oh, ok, cool, thanks, everyone. It does seem almost as simple as html; maybe I'll get further into it one of these days...

i hope you do

CSS is not a programming language. It is a declarative language for defining styles. It has no variables, conditionals, loops, logic, or commands. If you want to "program CSS", what you need to learn is JavaScript. JavaScript is a scripting language for manipulating the browser Document Object Model, which includes assigning declared styles (CSS) to document elements (HTML).

To put this into laymen terms, HTML determines the structure and meaning of content on a web page while CSS determines the style and appearance of this content. The two languages are independent of one another. CSS should not reside within an HTML document and vice versa.

http://www.handycss.com/tutorials/css-syntax-for-newbies/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.