Forums / Templates, Stylesheets, Page Layout / background color for text area main page...?

background color for text area main page...?

Locked

Started by wasana on 13 Jul 2007, 12:17 PM · Views: 2,952

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
13 Jul 2007, 12:17 PM
#1
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

background color for text area main page...?

It's got to be easy but I can't figure it out.

I want to add background color for a paragraph of text on the main page... I'm on a localhost so can't post but this must be a simple thing...

aardvark sez the area is called

div, id: indexcategoriesMaincontent, class:content

but that also includes an image that I rather not have the same background

the page is

/includes/languages/english/html_includes/MYTEMPLATE/define_main_page.php

I tried playing around to create something with that id in CSS but I ain't got the skills man...:mellow:

I thought it might be what the stylesheet calls 'textarea' duh, but there might be something else overriding that... sorry can't post URL but hope you might be able to point in right direction.

A bit of a primer on how to create the CSS identity would be most appreciated.

thanks

13 Jul 2007, 12:52 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: background color for text area main page...?

You don't say how the paragraph gets into your define_main_page.php, but I'm going to assume that you have access to the source code somehow.

So you're going to find the paragraph that needs the background and give it a semantically named class such as follows> <p class="bgHighlight">Your special text in here</p>Then you'll hop over to your stylesheet and add something like the following> .bgHightlight {background-color: pink}OK, you can choose a color other than pink if you really want ...

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

13 Jul 2007, 1:37 PM
#3
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Re: background color for text area main page...?

insert school girl giggles here...

thought you'd catch me with the typo - eh..?...(hightlight vs highlight) :blush:

THANK YOU - that small bit of advice launched me to the next level:yes:

(pink is interesting but too much of a class clash with the rest of my outfit...

13 Jul 2007, 1:39 PM
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: background color for text area main page...?

wasana:

thought you'd catch me with the typo - eh..?...(hightlight vs highlight)Naw, you're too smart for that. It's that this old brain just can't keep up with the fingers anymore :wink:

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

13 Jul 2007, 1:53 PM
#5
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Re: background color for text area main page...?

if I want to create a class for the image above the text...for to center it...?

I tried to cheat and mangled it a bit by adding in the define_main_page.php: > <p class="TEST_CLASS_NAME_img"<img src="images/large/TEST_IMAGE.jpg" alt="TestImage" title="TestTestTest" /></a></p>

then added a class per your example in the CSS ... not elegant but worked in Firefox but Internet Exasperater fails... proper terms for creating class...?

adding the paragraph <p also creates space I rather not have...

THANKS

13 Jul 2007, 2:00 PM
#6
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: background color for text area main page...?

There are a few problems with this as posted. The Initial p tag isn't closed and the a tag isn't opened. Hopefully just typos in the post.

Assuming that they were right, this may still not work as a way of centering the image. The reason is because the image may be giving each of the elements wrapped around it their width. So if the a tag and the p tag are only as wide as the image, then by default the image is already centered inside them.

I'd get rid of the p tag altogether it probably serves no useful function. Then I'd attach the class to the a tag. Provided the a tag is inline and not block or floated (can't tell from here) that should center the a tag and the image inside it within the div that contains them.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

13 Jul 2007, 3:40 PM
#7
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Re: background color for text area main page...?

thanks for the help -- as an interim mangle I'm using the <p's -- works okay in both FF & IE -- just adds some spacing I don't need - I must learn some of the details about divs/tags/classes etc. :dontgetit -- all in due time..your posts helped a lot