Current location: Hot Scripts Forums » General Web Coding » CSS » CSS Div + Span help


CSS Div + Span help

Reply
  #1 (permalink)  
Old 07-11-05, 04:18 AM
Arctic Arctic is offline
Wannabe Coder
 
Join Date: Jul 2003
Location: BC, Canada
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
CSS Div + Span help

Hi, this must be so simple, but I just can't figure it out. Although, I did do this successfully in my breadcrumb navigation. Anyways, heres my code:

This is my html:
Code:
<div><span class="headline_left"><img src="left.gif" alt="" /></span><div class="headline" align="center">Headline text goes here</div><span class="headline_right"><img src="right.gif" alt="" /></span></div>
Heres the CSS:
Code:
.headline{
	margin: 0;
	padding: 0;
	width: 517px;
}
.headline_left{
	margin: 0;
	padding: 0;
	float:left;
	width: auto;
}
.headline_right{
	margin: 0;
	padding: 0;
	float:right;
	width: auto;
}
Some of the stuff might not be required, I was just trying a bunch of stuff to try and get it working.

I am just stumped, because I did this for my breadcrumb nav and it worked, but not for this, if you need to see all my CSS or HTML look at http://www.sloaner.net. Any help would be great, thanks.
__________________
http://www.streamsearch.ca - Live stream search engine. Find radio stations to listen to and TV channels to watch!

http://www.machonemedia.ca - Mach One Media web development and media services.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-18-05, 08:43 PM
Arctic Arctic is offline
Wannabe Coder
 
Join Date: Jul 2003
Location: BC, Canada
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Sorry, I also forgot to mention that I just need the right quotation mark to be aligned with the left one. For some reason it is down pretty far, I used a negative margin but I need a different solution so it looks the same on each browser, or at least very similar.
__________________
http://www.streamsearch.ca - Live stream search engine. Find radio stations to listen to and TV channels to watch!

http://www.machonemedia.ca - Mach One Media web development and media services.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-20-05, 01:19 AM
earthman earthman is offline
New Member
 
Join Date: Jul 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Hard to tell whats going on without the images. What part of the site is this on?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 07-20-05, 02:19 AM
nothingofvalue nothingofvalue is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
I am not good enough with css to offer a "css only" solution, but an easy fix that should display exactly as you want it in any browser would be the following:

<table width="517">
<tr>
<th scope="col">&nbsp;
<div class="headline_left">
<img src="left.gif" alt="" />
</div></th>
<th scope="col">&nbsp;
<div class="headline" align="center">
Headline text goes here
</div></th>
<th scope="col">&nbsp;
<div class="headline_right">
<img src="right.gif" alt="" />
</div></th>
</tr>
</table>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 07-20-05, 02:49 AM
Arctic Arctic is offline
Wannabe Coder
 
Join Date: Jul 2003
Location: BC, Canada
Posts: 120
Thanks: 0
Thanked 1 Time in 1 Post
Thanks anyways, but I would like it to be complete CSS, because the rest of my site is all CSS (except for the header/nav).
__________________
http://www.streamsearch.ca - Live stream search engine. Find radio stations to listen to and TV channels to watch!

http://www.machonemedia.ca - Mach One Media web development and media services.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 07-20-05, 05:27 PM
nothingofvalue nothingofvalue is offline
Newbie Coder
 
Join Date: Jul 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
This should work, it did for me anyway an it is css only:

<style type="text/css">
<!--
body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; font-size: 12px}
p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px}
td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000;}
.floatleft {float: left; margin-top: 0px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px;}
.floatright {float: right; margin-top: 0px; margin-bottom: 10px; margin-left: 10px;margin-right: 0px;}
-->
</style>
</head>

<body>
<p>
<img src="image1.jpg" class="floatleft">
<img src="image2.jpg" class="floatright" >
</p>
<p>Some text here</p>
__________________
http://www.nothingofvalue.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Div Scrolling dwoody CSS 2 12-28-06 08:59 PM
Cross-browser CSS Help Arctic CSS 10 12-26-06 12:21 PM
Adapting CSS for different platforms pagetta CSS 1 01-12-05 08:13 AM
Change width of div if another div is not present hockeykid JavaScript 2 12-08-04 08:27 PM
getting the actual widht and height of a span davidklonski JavaScript 0 06-29-04 12:47 PM


All times are GMT -5. The time now is 09:56 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.