Issues with formatting of lists

Need help with CSS styling for multiple lists

#basic li, #standard li, #premium li {
padding-left: 30px;
padding-top: 3px;
padding-bottom: 5px;
background-image: url(../assets/misc/blue_yes.png);
background-repeat: no-repeat;
background-position: 0 .5em;
border-bottom: 1px dotted #CCC;
}
#high li {
padding-left: 30px;
padding-top: 3px;
padding-bottom: 5px;
background-image: url(../assets/misc/green_yes.png);
background-repeat: no-repeat;
background-position: 0 .5em;
border-bottom: 1px dotted #CCC;
}

I am trying to style four separate lists but running into an issue.

<ul id="basic">
                    <li>A</li>
                    <li>B</li>
                    <li>C</li>
                    <li>D</li>
                    <li>E</li>
                </ul>
<ul id="standard">
                    <li>A</li>
                    <li>B</li>
                    <li>C</li>
                    <li>D</li>
                    <li>E</li>
                </ul>



<ul id="high">
                    <li>A</li>
                    <li>B</li>
                    <li>C</li>
                    <li>D</li>
                    <li>E</li>
                </ul>



<ul id="premium">
                    <li>A</li>
                    <li>B</li>
                    <li>C</li>
                    <li>D</li>
                    <li>E</li>
                </ul>

The problem I'm facing is that only the first list is styled as intended with bullet images. Lists 2-4 are not displaying correctly. Any suggestions on how to ensure all four lists have the same styling?

Answer №1

Make sure to include the CSS rule list-style-type:none for ul elements.

Edit:-Inserting code snippet

CSS:

#basic,#standard,#premium,#high,#basic li, #standard li, #premium li,#high li{
    margin: 0;
    padding: 0;
    border: 0;
    vertical-align: baseline;
}
#basic,#standard,#premium,#high{
    list-style: none;
}

Answer №2

Consider assigning a unique class to every list you want to style, then apply CSS specifically for those classes instead of using IDs.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Applying a border with jQuery CSS on IE7 seems to be causing significant delays

While using HTTPWatch in IE7 to investigate why a specific page is loading slowly, I discovered that the issue only occurs in IE7 and not other browsers. After some investigation, I found that a single jquery line setting a border on two containers was cau ...

Disappearing text with HTML Bookmark and CSS Overflow:Hidden - What's happening?

Within the header of my webpage, there is an image div that has been styled with overflow:hidden. Inside the content section, I have a bookmark anchor tag: <a name="arghargh"></a> Located at the top of the content area, there is a link that ...

Adjust the height of Fullcalendar when the window is resized to maintain the aspect ratio as it shrinks

I am having trouble adjusting the height of an FC (fullcalendar) within a div. My goal is to have the FC completely fill the div without overflowing. Despite setting the height attribute during initialization, the FC's height does not resize properly, ...

Transforming Input Background Color with jQuery based on Matching PHP Array Entry

I am looking for a solution to implement form validation in PHP. The form has 3 fields: user, id, and email. When a user enters their name or id in the respective input fields, I want to check if the entered value matches any of the values in the PHP arra ...

Crafting a website in HTML

Hello there! I am looking to create a flexible HTML and CSS page that adjusts in size when the user resizes the browser window. I want the page to be responsive to different resolutions. I've explored various solutions on this platform, but unfortunat ...

An issue arose when attempting to load the page using jQuery

Currently, I am implementing the slidedeck jquery plugin on my webpage to display slides. While everything is functioning properly, I am facing an issue with the CSS loading process. After these slides, I have an import statement for another page that retr ...

Split the pane into divisions with a minimum width restriction

Is there a way to have two divs at 50% width, even if the content of the first div has a minimum size? <div class="col-xs-6"> <div style="min-width:1000px"> <label>The value here...</label> </div> </d ...

Maintain the collapsing of links in the navbar with the help of Bootstrap

Currently, I am designing a responsive navigation bar utilizing Bootstrap. The current layout displays as follows: https://i.sstatic.net/KglsX.png in expanded view, and: https://i.sstatic.net/DKvex.png in collapsed view. While the design appears satis ...

Unable to implement the `omega/theme.css` file within the angular.json configuration

"styles": [ "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.css", "node_modules/primeicons/primeicons.css", ...

Issue with relative input causing Jquery click event to not fire

Jquery $(document).on("click","[type=text]",function(event) { alert('test'); }); CSS .noWorking:focus{ z-index:100; position:relative; outline:none; box-shadow:0 0 0 1000px rgba(0,0,0,.2); } To ensure the shadow appears on top of all oth ...

enigmatic margin surrounding navigation dots

I have added a straightforward dot navigation to the banner of my website. You can check it out HERE. The HTML code I used is shown below: <ul class="carousel-dots"> <li> <a href=""></a> </li> <li> ...

What is the reason for the malfunctioning of this button upon clicking?

Attempting to customize my personal website by making the sidebar width change when the sidebar button is clicked. I'm puzzled as to why it's not working as intended. I prefer to figure it out independently but any helpful tips would be appreciat ...

Stop flexbox list items from altering the width of their parent container when the children are hovered over

In my project, I am dealing with a series of list items where some have child lists containing sub navigation links. To create a hover effect using CSS, I set display: none on the child <ul> and then change it to display: block when hovering over the ...

Identifying a Mobile Device on a Website: Tips and Tricks

Looking to implement specific CSS rules for mobile devices on my website. The goal is as follows: Design a clickable link for a phone number that is only functional on mobile devices Sample code: <a href="tel:+1234567890">+1234567890</a> (si ...

Creating a personalized button using Bootstrap

Struggling to create a unique custom button in Twitter Bootstrap 3. I am trying to design a button with a triangle in the right bottom corner like this: https://i.sstatic.net/IZAv0.jpg I have considered using the background of the button and adding text, ...

How should image dimensions for a background image be properly specified in CSS?

In my CSS file, I have defined styles for mini icons like this: /* Total counts - mini icons */ span.count-facebook { background: #fff url(../images/mini-icons/facebook.png) no-repeat 1px center; } span.count-plusone { background: #fff url(../images/mini- ...

Switch the color value from black to red with a click in JavaScript

I am currently developing an app and I'm in the process of creating a function that gradually changes the color from black to red based on a numerical value. For instance, if a user selects a number ranging from 0 to 100, they can click a button up to ...

Discovering the best method for accessing CSS classes locally within an Angular component

In order to style a 3rd-party component with custom styles, I need to access the dynamically generated css classname from within an angular component. Angular applies transformations to local css classnames for scoping purposes. However, when trying to st ...

How to set up an Angular animation using component input variables?

My goal is to introduce an @Input parameter that will define the timing of the animation in this demonstration of circle progress. However, the animation settings are currently specified within the @Component decorator, and it seems that this code does no ...

Assistance needed for Internet Explorer

When I designed a webpage in Firefox, everything looked great. However, when I opened it in Internet Explorer and resized the window to less than maximum size, half of the main div disappeared under the footer. If you want to see the issue for yourself, v ...