www.webdeveloper.com
Results 1 to 9 of 9

Thread: DIV and scrollbar

  1. #1
    Join Date
    Nov 2006
    Posts
    113

    Question DIV and scrollbar

    Hi,

    I have a web page which is displayed under IE and FF without any problem.
    However, under Opera it display a scroll bar (but not active = not scrollable).

    i've checked the css code and everything seems ok (no pixel outside the div)
    so where could be the problem located ?

    thanks a lot,

    A.

  2. #2
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    Would need to see your code. I suspect that the width of the item closely matches the parent's width (say, a 760px 'container' in a 770px 'wrapper' might cause this, as the scrollbar default-width is 20px, and some browsers include this with the stated "width", others, do not.. a work-around is stating a percentage-width instead... even if that is "width:100%;" this includes any scrollbars, whether needed or not)

  3. #3
    Join Date
    Nov 2006
    Posts
    113
    so here is the html code :
    <div id='ID_DivTopMenu' class='Div_TopMenu'>
    <a class='TopNavLink' href='#'>Contact_Us</a>
    |
    <img id='ID_TopNavArrow' class='TopNav_Arrow' src='temp.png' />
    <a id='ID_TopNavLang' class='TopNavLink' href='#'></a>
    |
    <a class='TopNavLink' href=''>My Account</a>
    <div id='ID_DivInterfaceLanguage' class='DivInterfaceLanguage' onmouseover='this.style.display="block";document.getElementById("ID_TopNavLang ").style.color="";' onmouseout='this.style.display="none";'>
    </div>
    </div>
    and here the css file :

    .Div_TopMenu
    {
    height : 20px;
    margin-top : 5px;
    margin-right : 5px;
    color : #5078b4;
    vertical-align : bottom;
    }
    .TopNavLink
    {
    margin : 0px 5px 0px 5px;
    color : #5078b4;
    vertical-align : bottom;
    }
    .TopNavLink:hover
    {
    color : #FAC81E;
    }
    .TopNav_Arrow
    {
    border-style : none;
    vertical-align : bottom;
    margin : 0px 5px 0px 7px;
    cursor : pointer;
    }
    .DivInterfaceLanguage
    {
    z-index: 4;
    position : absolute;
    display : none;
    cursor : pointer;
    border-color : #AAAAAA;
    }
    .UL_LangItem
    {
    margin : 0px 0px 0px 0px;
    padding : 0px 0px 0px 0px;
    vertical-align : middle;
    background-image : url(../images/common/topnav_tab_02.png);
    }
    .LangItem
    {
    margin : 0px 0px 0px 1px;
    padding : 3px 0px 0px 9px;
    vertical-align : middle;
    height : 15px;
    width : 70px;
    list-style: none;
    }
    .LangItem:hover
    {
    margin : 0px 0px 0px 1px;
    padding : 2px 0px 0px 9px;
    vertical-align : middle;
    height : 14px;
    width : 70px;
    list-style: none;
    background-color : #eaeaea;
    border-top-style : solid;
    border-bottom-style : solid;
    border-top-width : 1px;
    border-bottom-width : 1px;
    border-top-color : #FAC81E;
    border-bottom-color : #FAC81E;
    }

    .Div_TabPageTop
    {
    background-image : url(../images/common/topnav_tab_01.png);
    height : 20px;
    width : 81px;
    margin : 5px 0px 0px 0px;
    }
    .Div_TabPageBottom
    {
    background-image : url(../images/common/topnav_tab_03.png);
    height : 5px;
    width : 81px;
    }

  4. #4
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    That's kind of a hodgepodge, isn't it? I am seeing something totally unfamilar. And it is probably necessary to give a DIV an "ID" and a "class" unless the "class" given it going to be re-used again elsewhere on the same page. There is more CSS here than required.
    And for brevity, myself, I'd not name IDs thus: "#DIV_id_nameOfWhatever", I would just name the id, semantically when possible, and be done with it. If this ID is for a "wrapper", call it "#wrapper". If it is a sidebar, call it "#sidebar". Avoid confusion.

    And what is going on here?
    <div id='ID_DivTopMenu' class='Div_TopMenu'>

    is this related to the class below? If so, it's not going to function as-written..

    .Div_TopMenu
    {height : 20px;
    margin:0 5px;
    color : #5078b4;
    vertical-align : bottom;
    }
    I do not see any "#ID_DivTopMenu" at all in your CSS... this is possibly the whole problem.. -DIV(s) and possibly other elements named but incorrectly referanced in the CSS..
    Last edited by WebJoel; 12-31-2007 at 05:12 PM.

  5. #5
    Join Date
    Nov 2006
    Posts
    113
    i do not have any free web hosting space for now, so i will give here some screenshots.

    step 1 : no mouse pointer on one of those 3 links.
    step 2 : example how should look like a link when mouse is over it (yellow color)
    step 3 : as i wrote before, to make the tab behavior, i needed to place a div with a z-index higher range than the link (worldwide= language selection). but due to that, the link does not get the mouseover event and does not change its color to Yellow.
    step 4 : show the scrollbar only when the language selection div is displayed :-(
    Attached Images Attached Images

  6. #6
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    What browser are you using? IE will not take the pseudo-class for anything other than an anchor. I assume that they are anchor links.

    I don't know what you want with these images, but until we get right with:

    <div id='ID_DivTopMenu' class='Div_TopMenu'>

    .Div_TopMenu {...}, a problem remains. I see & note the class="" similar in name to this id, but there is no #ID_DivTopMenu in the CSS that I can see.
    I don't know what more can be done for you. The HTML cites a DIV named id="ID_DivTopMenu", -I don't think that there is anything in the CSS called "#ID_DivTopMenu" and maybe that is part of the problem..

    No live-hosting eh? Can you copy the ENTIRE code and past it into a post? The two segements that you showed aren't enough: -I re-built using them and see something entirely different than what your screenshot images show. Either we are using different browsers or user-agents (VERY likely.. -are you using Dreamweaver for this?), or, -there is some essential code not included (javascript probably, if this is a drop-down and we'd NEED that to see/test what you are doing and the code is quite ineffective without this)...
    What I see, is a 20-or-30px tall navigation bar, about 50px wide, that is chopped-off at the bottom, and nothing works at all..
    Last edited by WebJoel; 01-01-2008 at 11:22 AM.

  7. #7
    Join Date
    Nov 2006
    Posts
    113
    you will not find any #something in my css file because i use for that class='something'.

    i use only id for javascript actions

    A.

  8. #8
    Join Date
    Nov 2006
    Posts
    113
    i finally found what it was... my main div in which all the rest of web page elements are stored, had overflow : auto. :-(

  9. #9
    Join Date
    Dec 2005
    Location
    American, living in Toronto, ON. CANADA
    Posts
    6,746
    ok

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles