Lets get started, first CSS project

Been working hard on the tutorials but seem to have come to a stand still. Tutorials seem to be for the most part “beginners guide”.

So now I think the best Idea is to ask all the questions I can’t find the answers for.

My site will be simple - header, slide show, main body, footer. No sidebar, no links.
If I get the terms wrong please forgive me, and if my scripting is incorrect please point it out.

Question I. It appears to me that the days of using tables for the layout are gone. So I don’t need a main table/container table for everything ?? I was reading that some still think its the best way to go.

I’ve been checking out some CSS files and there are some things I’m not sure about.
Lets say I have :

<div class="w3-top">  Cant post it with the brackets

Question 2: Do I need to declare it in my CSS file before I can add selectors, eg:

.w3-top;
.w3-top
{
color:"#ff6666";
background-color:"#000000";
top:0;            /* is that the correct order ???
}

The reason I’m asking this is because I have the beginnings to a site but I seem to be having trouble with things like:

.w3- black;

I would have thought that was all that was needed, or:

.w3-black{
color:"#000000";
}

And I see some have done it like this:

.w3-black,  /* no semi colon  ????  

Back with my script and questions soon enough.

When you post code, format it as code. You may use the </> button on the toolbar to format selected text.
Or for an in-line snippet enclose with backticks.
For a block of code place three backticks on a line of their own before and after the block:-

`some code`

Yes.

Those people live in the past.

No.

The order does not matter.
Order does matter when rules contradict one another, the last rule wins (given the same specificity).

1 Like

Thanks dude, 5 minutes and I’ve learnt something.

You use a comma when you want to apply the same set of css rules to more than one selector. List the selectors separated by commas.

.thisClass,
.thatClass {
   background: blue;
}

In my CSS file I should declare w3-black like so:
(Test my posting of code)

w3-black{
color:"#000000";
}

or is just:

w3-black;

all that is required ?

And I haven’t been able to find anything on the use of “important”

Close, you are missing the preceding . to define a class as a selector.

.w3-black{
  color: #000 ;
}

I don’t know what that is. :confused:

Let’s keep in that way. :wink:
Generally, if you need to use it, you are doing something wrong.

Edit: Just noticed you have “quotes” around your colour for some reason.

1 Like

Yea, forgot the “dot” for the example.
And not sure why I’m putting quotes around the colors, it has hereby stopped.

thanks for your answers

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.