Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 05-09-2007, 03:13 PM Banner using CSS
PN-Matt's Avatar
Super Talker

Posts: 101
Location: London/Oxford, England
Trades: 0
Hi,

Does anyone know how to create a banner using CSS like the one attached?

I am trying to add something similar to my blog.

Can someone give me some code as a example please?

(Just used the MyBB one as a example )

Thank you
Attached Images
File Type: jpg bar-css.jpg (9.7 KB, 10 views)
__________________

Please login or register to view this content. Registration is FREE

Last edited by PN-Matt; 05-09-2007 at 03:22 PM.. Reason: Requesting a mod to move. Accidently posted this in the wrong forum
PN-Matt is offline
Reply With Quote
View Public Profile Visit PN-Matt's homepage!
 
 
Register now for full access!
Old 05-09-2007, 03:30 PM Re: Banner using CSS
King Spam Talker

Posts: 1,186
Location: Manchester, UK
Trades: 0
Use a graphics program to create a narrow vertical cross section of the banner (so that the weight of the image is small) and then use background-repeat along the x-axis like this:

HTML Code:
background: url(bg01.jpg) repeat-x;
For example the horizontal blue bar here is done that way: http://www.mediafire.com/

Last edited by gringo; 05-09-2007 at 03:31 PM..
gringo is offline
Reply With Quote
View Public Profile Visit gringo's homepage!
 
Old 05-09-2007, 03:56 PM Re: Banner using CSS
PN-Matt's Avatar
Super Talker

Posts: 101
Location: London/Oxford, England
Trades: 0
Thanks, Where do I place this code?

I take it I place it in my css file? Then what HTML would I need to add for it to show?

I tried putting it in my .css file and my background turned white.

Any assistance with this and I would be grateful.

Thank you
__________________

Please login or register to view this content. Registration is FREE
PN-Matt is offline
Reply With Quote
View Public Profile Visit PN-Matt's homepage!
 
Old 05-09-2007, 04:08 PM Re: Banner using CSS
King Spam Talker

Posts: 1,186
Location: Manchester, UK
Trades: 0
Yes that goes in your css. You would have something like this for the banner text:

HTML Code:
<div id="banner">Latest News yada yada</div>
and then your css would say:

HTML Code:
#banner {
background: background: url(bg01.jpg) repeat-x;
padding: 10px 0;
}
The padding is there just to give the div a bit of height (there might be more elegant ways to do this that LadynRed will show us when I've made a hash of this )so that your background image shows. If you get stuck, post a link to the page that has the problem.
gringo is offline
Reply With Quote
View Public Profile Visit gringo's homepage!
 
Old 05-09-2007, 04:29 PM Re: Banner using CSS
PN-Matt's Avatar
Super Talker

Posts: 101
Location: London/Oxford, England
Trades: 0
Hi,

The blog is http://www.mixedmatt.com

You can see near the top it says "test". It's still not working. I think it's a problem with the wordpress theme somewhere. Something in the css regarding that theme but I really am not experienced in this area.

Thanks for your assistance
__________________

Please login or register to view this content. Registration is FREE
PN-Matt is offline
Reply With Quote
View Public Profile Visit PN-Matt's homepage!
 
Old 05-09-2007, 04:34 PM Re: Banner using CSS
King Spam Talker

Posts: 1,186
Location: Manchester, UK
Trades: 0
If you look in the css file here http://www.mixedmatt.com/wp-content/...s-10/style.css

you have:
HTML Code:
background: background: url(http://www.mixedmatt.com/wp-content/themes/digg-3-columns-10/images/bg01.jpg) repeat-x;
The 'background' should only occur once.

Also, you would be better using a vertical cross section for your image that would repeat well horizontally, like this http://www.mediafire.com/images/main_fade.gif

Last edited by gringo; 05-09-2007 at 04:36 PM..
gringo is offline
Reply With Quote
View Public Profile Visit gringo's homepage!
 
Old 05-09-2007, 04:49 PM Re: Banner using CSS
angele803's Avatar
Perfectly Imperfect

Posts: 1,772
Name: Stephanie
Location: Oklahoma
Trades: 2
Try to change your CSS for #banner to this:

#banner {
background: url(http://www.mixedmatt.com/wp-content/...mages/bg01.jpg) repeat-x;
padding: 10px 0;
text-align: center;
}

****Edit****
Also, if you are just using a solid color for your background, just add the color to your CSS:

The color you have in your background image is FB4C49

So your CSS would look like this:

#banner {
background: #FB4C49 url(http://www.mixedmatt.com/wp-content/...mages/bg01.jpg) repeat-x;
padding: 10px 0;
text-align: center;
}

Last edited by angele803; 05-09-2007 at 04:55 PM..
angele803 is offline
Reply With Quote
View Public Profile
 
Old 05-09-2007, 05:24 PM Re: Banner using CSS
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Unless there's a pattern to that bar that I can't see, there's no reason to use an image at all. Define the <div> to the height you want, then give it the yellow background color. Next you add a 2px solid border at the top and bottom in the darker gold color.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 05-09-2007, 05:58 PM Re: Banner using CSS
PN-Matt's Avatar
Super Talker

Posts: 101
Location: London/Oxford, England
Trades: 0
http://www.mixedmatt.com

Getting closer. The top part is now red too.

Thanks for the assistance all. Ladynred I tried that method and had no idea what to do.

I used the code from angele803 post.

Matt
__________________

Please login or register to view this content. Registration is FREE
PN-Matt is offline
Reply With Quote
View Public Profile Visit PN-Matt's homepage!
 
Old 05-10-2007, 03:58 AM Re: Banner using CSS
King Spam Talker

Posts: 1,186
Location: Manchester, UK
Trades: 0
For the borders you will need:

HTML Code:
border-top: 2px solid #f00;
border-bottom: 2px solid #f00;
Alter the 2px to change the width and the #f00 to change the colour.
gringo is offline
Reply With Quote
View Public Profile Visit gringo's homepage!
 
Old 05-10-2007, 11:03 AM Re: Banner using CSS
angele803's Avatar
Perfectly Imperfect

Posts: 1,772
Name: Stephanie
Location: Oklahoma
Trades: 2
Try this:

#banner {
background: #FB4C49;
padding: 10px 0;
text-align: center;
border-top: 2px solid #f00;
border-bottom: 2px Solid #f00;
}

I think that should do it! (some of this was taken from other people's suggestions. I just wanted to put it together so it would be easier for you)
angele803 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Banner using CSS
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.50896 seconds with 13 queries