CSS - Advice needed - Please Bear With Me

D

Don

I am a total new starter when it comes to CSS but I believe I am learning
fast. I'm stuck and wonder if I am seeking a solution that just isn't
possible.

What I would like to do is have an entry in my style sheet that dictates all
images on a page will have a border, all parameters for that border to be
picked up from the style sheet (thickness, colour and so on).

I know I can define an entry in my sheet for example..

..picdefcol {
border: 1px solid;
border-bottom-color: Black;
border-right-color: Black;
border-left-color: #E3E3E3;
border-top-color: #E3E3E3;
}

It seems to me the only way to get the pictures to pick up the values is to
right click on them and then apply .picdefcol via the Style button.

Am I asking too much?

Any advice from you experienced guys and gals would be very much
appreciated.

Thank you,

Don
 
D

Don

Steve Easton said:
What you want to do is easy.

All it requires is:

img {
border: 1px solid;
border-bottom-color: Black;
border-right-color: Black;
border-left-color: #E3E3E3;
border-top-color: #E3E3E3;
}

The above will be applied to all images in all pages that use the style
sheet,
and you will not have to apply a class.



--
Steve Easton
Microsoft MVP FrontPage
FP Cleaner
http://www.95isalive.com/fixes/fpclean.htm
Hit Me FP
http://www.95isalive.com/fixes/HitMeFP.htm

Steve that is fantastic. I cannot thank you enough. I have struggled with
that for days and failed to find the answer by Googling. You are a star
mate.

Jon
 
M

Murray

You need to pay attention to Steve's solution in the larger context. So
many new users of CSS think that the only way to go is to create a custom
class for every style. As a result, your stylesheet fills with hundreds of
indecipherable custom classes that will be a mystery to you in a few short
months away from that site.

Instead, leverage the inheritance and cascade of CSS by using your selectors
wisely. For example, if you only wanted certain images (those within a
particular table/div to have the border style, you could do this -

table.special img {border:2px dashed red; }

and that would apply ONLY to image tags within a table having a class
assignment of "special".

One neat thing would be to use this approach to specify certain styles ONLY
on certain pages, e.g.,

body#contact img {border:12px indent green; }

would apply only on this page -

<body id="contact"

See what I mean?
 
P

P@tty Ayers

Steve that is fantastic. I cannot thank you enough. I have struggled
with that for days and failed to find the answer by Googling...

Things like this would be easy if you would go through a beginner's book or
tutorial on CSS, seriously. Playing around and experimenting is great, but
there's a simple logic to CSS which requires some book learning, I believe.
 
D

Don

Don said:
I am a total new starter when it comes to CSS but I believe I am learning
fast. I'm stuck and wonder if I am seeking a solution that just isn't
possible.

What I would like to do is have an entry in my style sheet that dictates
all images on a page will have a border, all parameters for that border to
be picked up from the style sheet (thickness, colour and so on).

I know I can define an entry in my sheet for example..

.picdefcol {
border: 1px solid;
border-bottom-color: Black;
border-right-color: Black;
border-left-color: #E3E3E3;
border-top-color: #E3E3E3;
}

It seems to me the only way to get the pictures to pick up the values is
to right click on them and then apply .picdefcol via the Style button.

Am I asking too much?

Any advice from you experienced guys and gals would be very much
appreciated.

Thank you,

Don

Thank you so much to all respondents. Your advice and guidance are very
much appreciated and taken to heart.

Don
 
H

Helpful person

Don said:
I am a total new starter when it comes to CSS but I believe I am learning
fast. I'm stuck and wonder if I am seeking a solution that just isn't
possible.

What I would like to do is have an entry in my style sheet that dictates all
images on a page will have a border, all parameters for that border to be
picked up from the style sheet (thickness, colour and so on).

I know I can define an entry in my sheet for example..

.picdefcol {
border: 1px solid;
border-bottom-color: Black;
border-right-color: Black;
border-left-color: #E3E3E3;
border-top-color: #E3E3E3;
}

It seems to me the only way to get the pictures to pick up the values is to
right click on them and then apply .picdefcol via the Style button.

Am I asking too much?

Any advice from you experienced guys and gals would be very much
appreciated.

Thank you,

Don

As a beginner with css I found this web site invaluable.

http://www.w3schools.com/css/default.asp

Please visit my web site at www.richardfisher.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top