Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS Problem. Background image duplicating when Height tag is added

Featured Replies

Hi,

 

I have a problem:

 

Basically I am trying to code a NAV bar in to Oscommerce. I have managed to do that and it displays fine in firefox. I now look on IE 8 and have and issue where the navbar basically repeats 3 times then shows the next button and so on.

 

I have tried setting the background to no-repeat etc and the background then disapears!. I seem to have narrowed it down to the height: line in my style. I wanted to make the height 20px which is the exact same height as the background image. As soon as I enter any height above 0px its starts duplicating the image again.

 

Can anyone help please?

 

Many thanks

joe

where is your <ul> for the <li>

 

Firefox is wrong in that it will often render lists without <UL> at the beginning or end :S

 

You may want to validate the code as well to iron out some other treats

 

http://validator.w3.org/check?uri=http://www.inteu.com/english/cart/index.php%3FcPath%3D31&charset=(detect+automatically)&doctype=Inline&ss=1&outline=1&group=0&user-agent=W3C_Validator/1.1

  • Author

Hey :)

 

Thanks alot :) well I added the <ul> tags and its made it worse haha. Is there any other tags I could use to do the same thing?

 

Many thanks

Joe

Is this some sort of generated code ?

 

This should give you a start I wouldn't use inline styling

 

 

html

 

<ul>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Company Names</a></li>
<li><a href="#">Company Names - 250</a></li>
<li><a href="#">Company Names - 500</a></li>
<li><a href="#">Company Names - 750</a></li>
<li><a href="#">Company Names - 1000</a></li>
<li><a href="#">Company Names - 2500</a></li>
<li><a href="#">Company Names - 5000</a></li>
<li><a href="#">Web Packages</a></li>
</ul>

 

css

 

*{margin:0;padding:0;}
ul{list-style:none;width:200px;}
li{background-image:url("internal/images/menubar.png");height:20px;}

  • Author

Hey :)

 

Thanks for the reply Mteam :)

 

The <li> code is this:

 

'name' => '<li style="background-image:url(internal/images/menubar.png)">' . $categories['categories_name'],
                                                   'parent' => $categories['parent_id'] . '</li>' ,
                                                   'level' => 0,
                                                   'path' => $categories['categories_id'],
                                                   'next_id' => false);

 

I've tried the <li> styles in a CSS file aswell and its no joy either exactly the same error :/

 

It strange as If i remove the height tag in the style it works fine (but isnt the full image height!)

 

Many thanks

Joe

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.