6 Replies - 524 Views - Last Post: 06 July 2009 - 03:40 PM

#1 ghqwerty   User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

coloured bars

Posted 03 July 2009 - 05:03 AM

ok so i have 3 little sections at the moment which slide down to reveal more links using jquery

now i added this bit of css to it

#slider { 
color: #ffffff; 
background: #336600;
width: 150px;
text-decoration: none;
}



to give it a bar of colour to make it lok better. in ie the bar stretches the correct width however in FF the bar only stretches the width of the text
Is This A Good Question/Topic? 0
  • +

Replies To: coloured bars

#2 BetaWar   User is offline

  • #include "soul.h"
  • member icon

Reputation: 1647
  • View blog
  • Posts: 8,510
  • Joined: 07-September 06

Re: coloured bars

Posted 03 July 2009 - 09:04 AM

FF is a minimalist. Try this:
#slider { 
color: #ffffff; 
background: #336600;
width: 150px;
min-width: 150px;
text-decoration: none;
}

Was This Post Helpful? 0
  • +
  • -

#3 ghqwerty   User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

Re: coloured bars

Posted 03 July 2009 - 09:11 AM

ive already tried that and it doesnt work :S

havent tried it with both width and min width thoug, will try that


---------------
nope still doesnt work

This post has been edited by ghqwerty: 03 July 2009 - 09:12 AM

Was This Post Helpful? 0
  • +
  • -

#4 BetaWar   User is offline

  • #include "soul.h"
  • member icon

Reputation: 1647
  • View blog
  • Posts: 8,510
  • Joined: 07-September 06

Re: coloured bars

Posted 03 July 2009 - 09:15 AM

Hm, are you using a span or div for this? They both act differently.
Was This Post Helpful? 0
  • +
  • -

#5 ghqwerty   User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

Re: coloured bars

Posted 03 July 2009 - 09:18 AM

links actually because im using jqeury, heres the bit about the link

var a = $("<a id='slider'>Forts</a><br/>").attr('href','#').addClass("btn-slide3");
	$('#panel3').before(a);


Was This Post Helpful? 0
  • +
  • -

#6 ghqwerty   User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

Re: coloured bars

Posted 03 July 2009 - 02:28 PM

changed the links to divs and it works fine, dont know why
Was This Post Helpful? 0
  • +
  • -

#7 joezim007   User is offline

  • D.I.C Head
  • member icon

Reputation: 11
  • View blog
  • Posts: 110
  • Joined: 13-September 08

Re: coloured bars

Posted 06 July 2009 - 03:40 PM

View Postghqwerty, on 3 Jul, 2009 - 02:28 PM, said:

changed the links to divs and it works fine, dont know why


Links are "in-line" elements meaning that they cannot be explicitly sized and that they will not create a new line before and after it. A Div on the other hand is a "block" element meaning it can be explicitly sized and will cause a line break before and after it. So, since a div can be explicitly sized and a link cannot, the div will work for your sizing while an anchor tag won't. You'll have to look up the rest of the tags to find out what kind of elements they are, but you can explicitly set the way it is displayed using the display property in CSS:
display:"block";

or 

display:"in-line";



There are also other displays like table-row and such but the first two mentioned should be enough for most people. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1