Go Back   RCCrawler Forums > Miscellaneous > Chit Chat
Loading

Notices

Thread: Any CSS junkies out there?

Reply
 
LinkBack Thread Tools Display Modes
Old 07-29-2007, 04:15 PM   #1
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default Any CSS junkies out there?

Im learning CSS, and want to add a repeating background behind my header. My question is this, do I add the BG command in the head.tpl file or the CSS file? Does it even matter? All of my efforts are causing my site to stop working so far, but im gonna get this.
JohnRobHolmes is offline   Reply With Quote
Sponsored Links
Old 07-29-2007, 04:32 PM   #2
Quarry Creeper
 
Join Date: Oct 2004
Location: illinois
Posts: 433
Default

I thought you meant Counterstrike Source, but then your question confused me:-P
Soya is offline   Reply With Quote
Old 07-29-2007, 05:05 PM   #3
I wanna be Dave
 
Join Date: Oct 2005
Location: Columbia TN
Posts: 6,154
Default

Pm cotharus, he helped me with code before.
Kamikaze is offline   Reply With Quote
Old 07-29-2007, 05:09 PM   #4
Rock Crawler
 
Join Date: Jun 2006
Location: Dallas, Oregon
Posts: 567
Default

i thought he was talking about counter strike too!!
scuzzy51 is offline   Reply With Quote
Old 07-29-2007, 05:40 PM   #5
RCC Addict
 
Join Date: Apr 2004
Location: Santa Clara
Posts: 1,456
Default

Hey John,
Your best location will be up to how you want to manage it. For one stop shopping, I try to put everything in the CSS file. So within the CSS file I might have a this:

Code:
td.bgheader {
background-image: url(../images/bgheader.gif)
}
And then in your header template location you would have this:
[HTML]
[/HTML]

Because it is deemed a background, it should auto repeat. However, you can define that and where it goes as well if you want to get tricky.

A great place with quick answers that I always lean back on is this:
http://www.w3schools.com/css/

There are plenty of links for help, but this place seems to always have the answer I need right away.

-Sam
SlinkySam is offline   Reply With Quote
Old 07-29-2007, 05:45 PM   #6
Quarry Creeper
 
Join Date: Jan 2005
Location: Vancouver Island BC... that's Canada eh
Posts: 229
Default

I just took a look at your sites code.

To keep it really simple you could add this to your css file:

body {
background: url("your image path and name here") repeat-x;
}

This would work if you have an image less than 150px high and want it to repeat(fill) right across the top or your site. There isn't an image already specified for your body tag so this would be an easy fix. Only have to edit one file. The style sheet.

Last edited by Mr_Freeze; 07-29-2007 at 05:54 PM.
Mr_Freeze is offline   Reply With Quote
Old 07-30-2007, 01:36 AM   #7
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default

Quote:
Originally Posted by Mr_Freeze View Post
I just took a look at your sites code.

To keep it really simple you could add this to your css file:

body {
background: url("your image path and name here") repeat-x;
}

This would work if you have an image less than 150px high and want it to repeat(fill) right across the top or your site. There isn't an image already specified for your body tag so this would be an easy fix. Only have to edit one file. The style sheet.


Wouldnt this be breaking the CSS format of my site by forcing the background on all < body > on my site instead of inserting the style on the CSS and only calling it up in the parts of my website that I wanted? I'm not sure what is going on still though. No matter how I modify my CSS and templates I cant call up anything. I know it isn't a cache issue either, as other changes are being updated.
JohnRobHolmes is offline   Reply With Quote
Old 07-30-2007, 08:13 AM   #8
Quarry Creeper
 
Join Date: Jan 2005
Location: Vancouver Island BC... that's Canada eh
Posts: 229
Default

Hmmm... not sure what you mean by breaking the css format.

All html pages have a head and body tag. The content that is generally contained within the body tag. What I suggested doesn't require editing anything other than the stylesheet as all pages already have the body tag.

You are correct in that this would add the repeating background on all pages that use the style sheet. But... the background would not fill the whole page as you'll note I added "repeat-x". This will cause the image to repeat on the x-axis only which means one row/repeat across the screen. I did not specify "top left" or "0 0" as that is the default position anyways.

Did you want it on one page only or were you just concerned that it would fill your whole page?
Mr_Freeze is offline   Reply With Quote
Old 07-30-2007, 09:05 AM   #9
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default

Instead of creating a class and calling it from my header template, I would just be inserting html into my CSS file right?

I tried adding that to my Body and it didn't work. My guess is that something else is overriding it.
JohnRobHolmes is offline   Reply With Quote
Old 07-30-2007, 09:24 AM   #10
Quarry Creeper
 
Join Date: Jan 2005
Location: Vancouver Island BC... that's Canada eh
Posts: 229
Default

Hi John,

I just checked your site again.

If you put the line of code I noted before in this file:
http://holmeshobbies.com/skin1/skin1.css
It will show up for you. "Body" will not be a new class, just adding an additional style to an existing html tag. Easy-peasy.

The only thing you will have to edit is path to your image. You can pm me if you like and I can go into more details this eve if you need more help.
Mr_Freeze is offline   Reply With Quote
Old 07-30-2007, 10:48 AM   #11
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default

Ok, did that and my background color went away. If I change the style to background-image:etc the image disappears.


I want to keep my background color, and still have the image. What am I missing?

Last edited by JohnRobHolmes; 07-30-2007 at 10:53 AM.
JohnRobHolmes is offline   Reply With Quote
Old 07-30-2007, 11:23 AM   #12
RCC Addict
 
Join Date: Aug 2006
Location: trying to find out what a TVuPer is.....
Posts: 1,851
Default

Quote:
Originally Posted by Soya View Post
I thought you meant Counterstrike Source, but then your question confused me:-P
CS:S.
mrpink is offline   Reply With Quote
Old 07-30-2007, 11:26 AM   #13
RCC Addict
 
Join Date: May 2006
Location: USA
Posts: 1,043
Default

this is a site you HAVE to check out:

http://www.w3schools.com/
BrandonW is offline   Reply With Quote
Old 07-30-2007, 11:27 AM   #14
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default

I have been reading that site for a few days now. Still dont quite get it, even though I know html. It is probably because I am tired when I read it.
JohnRobHolmes is offline   Reply With Quote
Old 07-30-2007, 03:03 PM   #15
Quarry Creeper
 
Join Date: Jan 2005
Location: Vancouver Island BC... that's Canada eh
Posts: 229
Default

Hmmm... a little bit of mixed up code you have there. Try this:

This kills all birds with the same stone.

body {
background: #cccccc url("your image path and name here") repeat-x;
}

I have added the "#cccccc" which is the color specification for the body tag. This is the color that will fill the body of your site. Basically the whole page. Assuming that your background color was #cccccc. You can just swap in the original color. Could have been #aaaaaa or #666666. Can't remember right now...
Mr_Freeze is offline   Reply With Quote
Old 07-30-2007, 04:48 PM   #16
owner, Holmes Hobbies LLC
 
JohnRobHolmes's Avatar
 
Join Date: Nov 2004
Location: Volt up! Gear down!
Posts: 20,290
Default

ah ha! That worked. Now I just gotta learn how to add new classes and call them up, in case I want different backgrounds for different parts of the site or something.
JohnRobHolmes is offline   Reply With Quote
Old 07-30-2007, 09:05 PM   #17
RCC Addict
 
Join Date: Apr 2004
Location: Santa Clara
Posts: 1,456
Default

Quote:
Originally Posted by johnrobholmes View Post
ah ha! That worked. Now I just gotta learn how to add new classes and call them up, in case I want different backgrounds for different parts of the site or something.
Just do what I posted earlier and that gives you the freedom of different backgrounds wherever you want.

-Sam
SlinkySam is offline   Reply With Quote
Reply




Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 08:50 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO ©2011, Crawlability, Inc.
Copyright 2004-2014 RCCrawler.com