Skip navigation.

CSS for Dummies!

>the blog<

Selectors

, ,

Before getting our hands dirty by pimpin' our blogs, we need to understand what the selectors are. In this post we'll discuse that.

As I told you before, a selector is the part of the page that we're going to modify. Your Opera Blog handles three kinds of selectors: id, type and class.

The id selector (#name) is the one that modifies a certain section of the blog, such as the header, the sidebar or the posts.

#top {
background:#335fa3 url(/community/graphics/themes/top-blue.gif); 
border-bottom:1px solid #ddd;
color:#fff;
}

If you take a look at the source of you blog, you'll find something similar to this
<div id="top">

That means that everything between both "divs" will be modified by the #top selector.

The type selector is used to modify a specific HTML tag, within the id selector. To use it you just have to type the tag you want to modify in front of the id selector.

#top h1 {
padding-top:22px;
}

In the example, we are modifying the h1 tag within the #top selector.

Finally, a class selector applies to many elements at once, or a sub-set of specific HTML elements, like the color of the username link (it will only modify such item)

a.username:link,  a.username:visited,  {
color:#176b9b;
}

As you can see, you can apply style to several selectors at once just by separating them with a comma.

TASK!
Identify the selectors in the CSS of the last post and write down which type they are. On the next post we're going to start having fun!

10New FORUM

Comments

Randall 8. August 2007, 13:58

explain "source" p: tech people take that for granted :D

urrrrr so:

#menu {
background:#f8f8f8 url(/community/graphics/themes/menu1.gif);
border-bottom:1px solid #fff;
}

would be a selector? or is just this part: #menu considered the selector? :eyes:

Ruben Garcia 8. August 2007, 16:00

You can see the source code of your blog by choosing View --> source in the menu of your browser.

The source code are the instructions that your browser follows to display the page.

Only the #menu part is considered the selector, the other parts are the properties and the values, which we'll cover later.

Randall 8. August 2007, 16:55

ahhh :smile: thanks for that p:

The Dark Furie 18. August 2007, 02:03

And how do us phone users see the source code? Is there somewhere we can go for that?

If not could we have a large selectors "map" to reference?

. 8. September 2007, 22:11

O,o In need of help please.

http://files.myopera.com/Kite%20Geek/files/Transformers-Banner5Kite.jpg

OK, I have my graphics in my file thingy here in Opera as it shows...

But, when you put in the infor into the CSS design page with ( and ) around it of course P:

The % of the %20 goes away. O,o And, I can not see the image.

I tried using - , and _ and nothing, and also yousillythingyou. But, nothing has worked... Did I kill it?

Sorry if this is the wrong spot for this. @,*

Violeta Rosales 8. September 2007, 23:37

I think you already fix it. If you don't, tell me! :smile:

. 9. September 2007, 13:47

LOL, no I did not fix it. I knew that I can also link direct to ImageShack or another image host like that.

It seems that CSS treats the % in from of 20 as nothing. Or, the % is used in another way with CSS... Not sure yet. P:

But, for now I do have a means to have my own images show. :smile:

Sheesh, I thought my basic HTML would help me more. LOL P:

Louc 20. September 2007, 08:19

O,o In need of help please.

http://files.myopera.com/Kite%20Geek/files/Transformers-Banner5Kite.jpg

OK, I have my graphics in my file thingy here in Opera as it shows...

But, when you put in the infor into the CSS design page with ( and ) around it of course P:

The % of the %20 goes away. O,o And, I can not see the image.

I tried using - , and _ and nothing, and also yousillythingyou. But, nothing has worked... Did I kill it?

Sorry if this is the wrong spot for this. @,*



I guess Im having the same problem :frown:

http://files.myopera.com/louderf_manila/albums/359088/chalkboardsnap%20copy.png

. 20. September 2007, 09:15

Use ImageShack.Com to host the images, I had to do that. :smile:

Randall 21. September 2007, 02:42

smart Kite

. 21. September 2007, 12:54

The other option I think will work... Is to use your blog to act as if you will upload an image... It loads it in a way that will allow you to post the code... And, stores it on Opera's servers, you can then cut that code paste it to where you need it and poof... your CSS now has you image hosted where it could not with a %20 before as the link to the image does not include that part... It is only half of the link I think... O,o Not sure why it works.


Louc 21. September 2007, 22:14

I see but still wont work... I guess I need more time to learn the codings. Thanx kite. p:

Violeta Rosales 22. September 2007, 03:58

Ok boys... Here we go!!

I don't know what's happening with that %20, but i have a solution to all of your problems, the %20 means a "blank space" (wich is not recomended on web sites) so:

louderf_manila: the name of you image is chalkboardsnap copy.png, right??? Well.. RENAME IT to chalkboardsnapcopy.png or chalkboardsnap_copy.png :D :D That's it. Please try it and tell me, ok? :wink:

Louc 22. September 2007, 04:11

Yea It works but the image seem like I should resize it but I dont know what's the width and the height that fits the image exactly p:
Thank you guys for helping me out :D
Gracias mi amigos/amigas xD

Violeta Rosales 22. September 2007, 04:19

It must be 921 x 170 px :smile: :smile:

De nada amigo! :D

The Dark Furie 22. September 2007, 10:35

921? Bugger!

. 22. September 2007, 10:42

OK, I have one... Why do flash movies show and work... And, are as large as you want, and are a few MB's in size...

And, a 1.3mb gif about the size of the reply entry box will not load as a .gif in my blog? It ends up being converted to a .jpg img on the blog, while the image is still stored as a .gif... O,o

I am thinking it has a px size limit I must be over... :frown:

But, I can make the same .gif into a Flash movie... and it works and at any size... O,o

The Dark Furie 22. September 2007, 10:47

Randy's gonna get you for that avatar. :sst: Keep it for a while. I wanna see his reaction.

Louc 22. September 2007, 11:46

Thanx violy p:
lolz furie,
brilliant kite xD

. 22. September 2007, 14:00

He saw it already silly.


And I have yours also P:

The Dark Furie 22. September 2007, 14:57

Mine has evil meaning. Plus I have it on official loan from a business so don't muck with it please.

Louc 22. September 2007, 14:59

Lolz, dont get serious p:

Randall 22. September 2007, 15:27

la de da de da...:smile: ...:left:...:right:

hmmm... I find I comment twice as much these days :eyes: ..I wonder why? :left:

The Dark Furie 22. September 2007, 18:36

Because you are truly learning the way of the Furie. :ninja:

Kite ya twonk. :irked:

. 22. September 2007, 19:57

LOL I made that weeks ago, LOL P:

Yeah I think the red is not cute enough... P: LOL Hmmm... Maybe I should use the Opera Admin avatar I mad instead... P: LOL Cept... It like all the other avatars I have has been changed a bit P:

Randall 23. September 2007, 02:48

:lol: ..."twonk" :lol:!!!!

. 23. September 2007, 09:20

LOL I must be moving up in my evilness... O,o P:

Louc 23. September 2007, 21:11

Thats horrible kite :D

Jenn 18. December 2007, 09:01

This is my one question...Am I missing something? I dont understand

/community/graphics/themes

If I have a gif or another graphic I want to use..Do I make a "directory/folder" in my files where I upload graphics in my account?

I hope I worded that right?

Thanks for help :D

Randall 27. November 2008, 19:13

waz up Dummies? :D

okay that didn't come out right :right:

speaking of "Dummy" :o: ..I need a Code, Code :eyes: yes a Code, Code!

I sound stupid don't I :frown:

you know! :mad: the CSS to change the background colour & text colour when you write a code for someone to see. :D (Like was done in this post by EZTIGMA)

:spock:

Violeta Rosales 27. November 2008, 19:29

Hi Randall!!! :D

I think that would be:

pre , code {background:#FFFFFF;
color:#000000;}


Test it :wink:.

Randall 27. November 2008, 20:00

hmmm I'll try it later :D thanks p:

Randall 27. November 2008, 20:22

sweet :D it worked :yes:

hey I didn't envision this group for nuthin! :lol:

thanks violetisha :wink:

Violeta Rosales 27. November 2008, 22:06

No problem Randy :smile:

I added your friend, but it seems to be offline :frown:.

Randall 28. November 2008, 02:18

hmmm well maybe you'll get her tomorrow.

her CSS is basic so it will be a breeze to fix for someone like you :up:

Thanks for everything girl :D

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies

January 2010
M T W T F S S
December 2009February 2010
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31