1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Scrollbar - iframe????

Discussion in 'CSS' started by le007, Oct 2, 2008.

  1. #1
    I need a sort of iframe in a website I'm designing. Whats the best way to do this in css? Just a div or what? I need a scroller on it though as the content will be pretty long and needs to be "scrollable" - it'll also be centered to about 800px. I'd like a coloured scrollbar - just wondering does anyone know the best way to go around this?
    Thanks,
    Le007

    example of what I'm after:

    http://www.frame.dk/#/WORK
     
    le007, Oct 2, 2008 IP
  2. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #2
    Don't use iframes. Here's an example how to do it with div tags instead:
    <div style="width: 600px; height: 400px; overflow:auto;">
     Your text here. Needs to be long enough for the vertical scroller to show.
    </div>
    Code (markup):
     
    Clive, Oct 3, 2008 IP
  3. mypsdtohtml

    mypsdtohtml Guest

    Messages:
    96
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi

    You don't use CSS, you use <iframe> tag in the XHTML.
     
    mypsdtohtml, Oct 3, 2008 IP
  4. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #4
    Shortest and best phrase ever containing the XHTML/CSS and iframe keywords. :)

    Simply put, In XHTML 1.0 Strict, for instance, the iframe tag is not allowed.
     
    Clive, Oct 3, 2008 IP
  5. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #5
    So how can I have a scroller without iframe dudes?
     
    le007, Oct 3, 2008 IP
  6. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #6
    I'll post it again, looks like you've missed my reply,
    or are unaware that it is the answer to your question :)

    <div style="width: 600px; height: 400px; overflow:auto;">
     Your text here. Needs to be long enough for the vertical scroller to show.
    </div>
    Code (markup):
     
    Clive, Oct 3, 2008 IP
  7. Resco

    Resco Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    43
    #7
    Right, that's it. And it's better supported than iframes.
     
    Resco, Oct 3, 2008 IP
  8. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #8
    Yeah, but will a scrollbar appear and if so is that stye-able as I'm looking for this type of effect? Thanks guyz
    http://www.frame.dk/#/WORK
     
    le007, Oct 4, 2008 IP
  9. Clive

    Clive Web Developer

    Messages:
    4,507
    Likes Received:
    297
    Best Answers:
    0
    Trophy Points:
    250
    #9
    Have you checked the code that I gave you?
     
    Clive, Oct 4, 2008 IP
    Stomme poes likes this.
  10. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #10
    yeah I did but no scroller appeared?
     
    le007, Oct 4, 2008 IP
  11. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #11
    ok yep there it is :D

    Thank you Clive, how can I change the scrollers colour etc?
     
    le007, Oct 4, 2008 IP
  12. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #12
    anyone got any ideas please?
     
    le007, Oct 5, 2008 IP
  13. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Teh scrollbars, ze are mah scrollbars, not yours. MINE! You isn't touchin' mah scrollbarz. You isn't touchin' mah input type=file buttunz, you isn't touchin mah browser menuz, you isn't touchin' mah browser.

    Not without a pile of scripts, the likes of which I ain't lettin in MAH browser.

    : )


    Though IE does have proprietary scrollbar codez in CSS which are not valid but don't hurt anything.
     
    Stomme poes, Oct 6, 2008 IP
  14. steelfrog

    steelfrog Peon

    Messages:
    537
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #14
    If you're looking to generate valid CSS, then you simply don't. Most browsers ignore custom scroll bar colors anyway (with the exception of some older IE versions).

    However, if you still want to go ahead and change them, you can use this generator to help you out.
     
    steelfrog, Oct 6, 2008 IP
  15. le007

    le007 Well-Known Member

    Messages:
    481
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #15
    Thanks guyz for the help
     
    le007, Oct 6, 2008 IP
  16. snake charmer

    snake charmer Guest

    Messages:
    78
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #16
    put in a div id and use overflow:auto;
     
    snake charmer, Oct 7, 2008 IP