Internet Explorer does not display CSS effectively

Having issues with CSS on Internet Explorer

While this page displays correctly in Firefox, Chrome, and Opera, on IE the "date bar" is overlapping on the first <li> bar

View the issue here:

The current CSS code is:

#content h2.other-posts {
    height: 31px;
    font-size:12px;
    line-height: 31px;
    background: #2c2b2b;
    padding: 0 10px;
    border: 1px solid #1b1b1b;
    color: #888888;
    margin-bottom:1px;
}

#content #other-posts {
    list-style: none;
    padding: 1px;
    margin-top:15px;
    margin-bottom:15px;
    margin-left: 20px;
}
#other-posts li {
    list-style: none;
    background: #151515;
    height: 30px;
    line-height: 30px;
    border-left: 1px solid #050505;
    border-right: 1px solid #151515;
    border-bottom: 1px solid #050505;
    border-top:1px solid #0f0f0f;
    margin-bottom: 1px;
    padding: 0 10px;
}

#other-posts li a {
    float: left;
}

The PHP file in Wordpress is as follows:

<ul id="other-posts">

<?php
$postslist = get_posts('numberposts=50&order=desc&orderby=date');
foreach ($postslist as $post) : setup_postdata($post);
?> 
<?php the_date('', '<h2 class="other-posts">Added on ', '</h2>'); ?>

 <li><a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>">
   <?php the_title(); ?>
   </a></li>

<?php endforeach; ?>
</ul>

Seeking solution to make this render correctly in all browsers

Answer №1

One approach to consider is using conditional comments specific to IE. By doing this, you can effectively address any quirks or issues that are unique to Internet Explorer by creating a separate stylesheet specifically for IE.

<!--[if IE]><link rel="stylesheet" type="text/css" href="ie/specific/css.css"> <![endif]-->

Answer №2

Give this a shot:

#more-posts li { display:inline-block; }

Instead of trying to apply the display rule to "li a", make sure you're targeting the list item itself to be displayed inline.

UPDATE: My mistake. Not sure where that 'without' came from.

Give it a go without the float and set a specific width or height for the list.

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

Transferring information between pop-up and webpage

I have developed a simple form within an ERP system that allows users to create quick support tickets. However, instead of manually inputting the client ID in the form, I want to provide them with a more user-friendly option. My idea is to include a search ...

I require displaying the initial three letters of the term "basketball" and then adding dots

Just starting out with CSS and struggling with the flex property. Seems to work fine at larger sizes, but when I reduce the screen size to 320px, I run into issues... Can anyone help me display only the first three letters of "basketball ...

Issue with Next.js: Setting the width to 100vh prevents the height from being responsive on mobile devices

While I understand that using height: 100vh on mobile is generally discouraged for various reasons, I'm curious as to why height: 100vh paired with width: 100vh in Next.js doesn't produce the expected result. Instead of a full-height square, I en ...

Conceal an element from view upon clicking on it

Task at Hand : Implement a smooth element hiding effect upon clicking, similar to the behavior on this website , where the letter A fades away smoothly when clicked. Is it possible to achieve this effect using only HTML, CSS, and JavaScript? var t ...

What is the best way to ensure that the size of a header is balanced on both margins?

I just recently began learning CSS about a week and a half ago, and I'm facing a challenge that I'm struggling to overcome. I want my webpage to have the same design as shown in this image, but despite trying various solutions, I can't seem ...

Choose the div element that is immediately before the current div

Attempting to create a harmonica effect by adjusting the height of divs upon hovering over another. The HTML is structured as follows: <html><body> <div class="section1"></div> <div class="section2"></div> <di ...

Adding a timestamp to the src URL in HTML: A step-by-step guide

Looking for a way to implement cache busting in my index.html file. Take a look at the code snippet below: <body> <app-root></app-root> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="&l ...

AngularJS enables the loading of directives dynamically, but sometimes encounters errors such as "Restricted URI access denied."

Presently, I am in the process of developing a small educational project using HTML5, CSS, JS and AngularJS. Hiccup: Loading an AngularJS Directive in my index.html file Error code [1] - Local browser Error: Access to restricted URI denied Various resp ...

What is the best way to add a gradient background image to a container that also has margins?

I am currently working on a push menu that shifts the main content container by adding margin-left to it. I am aiming to achieve a background image effect similar to what is seen on . Here is the progress I have made so far in my codepen: https://codepen ...

Double tap problem with pseudo elements on iOS links

Trying to achieve a scrolling line effect beneath anchor links for a client project led me to attempt some CSS3 coding, only to find myself stuck with an elusive bug after spending hours on it. The issue arises on mobile devices (iOS and Android) where, up ...

How can I efficiently load AJAX JSON data into HTML elements using jQuery with minimal code?

I have successfully implemented a script that loads an AJAX file using $.getJSON and inserts the data into 2 html tags. Now, I want to expand the JSON file and update 30 different tags with various data. Each tag Id corresponds to the key in the JSON strin ...

Reinitializing the Qt Stylesheet seems to have no effect

Attempting to modify the style of a window and all its children using stylesheets. Each child is given a name using setObjectName, and the stylesheet uses these names to modify the style of the named widgets, along with a few exceptions. To achieve this, ...

Why aren't CSS media queries functioning in the existing stylesheet?

I have a good grasp on responsive design and CSS techniques. However, I am encountering an issue where the media query for mobile dimensions is not working as expected. When monitoring the applied styles in Chrome, only the min-device-width styles are be ...

What is the best way to show the page before loading custom fonts?

My website is time-sensitive and I need it to prioritize displaying the page before loading any custom fonts. Essentially, I want the page to show up initially as if the fonts are not loaded. This way, the custom fonts (if already cached by the browser) w ...

Is it necessary to scroll when all elements on the page are in absolute position?

I have all elements positioned absolutely on my page. Some are at the top and some are at the bottom. However, when I add an additional element to display news text in the center of the page, it gets hidden under the element aligned at the bottom. When I s ...

Can you explain the purpose of the #shadow-root found within elements?

Today I witnessed something out of the ordinary. Take a look at the images attached to this post. Specifically, pay attention to the input[type="text"] labeled as "1" in the screen picture. The CSS styling for it appears as follows: tab ...

Is it feasible to add a row in bold font following every set of 10 rows written in regular text?

Looking for a way to implement pagination on a table with dynamic headers? I am using rows with font-weight:bold to act as headers for the pagination. Is it possible to insert a row with font-weight:bold every 10 rows? I am unsure of how to achieve this, ...

The Bootstrap mobile menu is hidden behind the first section's content when opening

I'm encountering a problem with my bootstrap 3 mobile menu - it is opening underneath the content of my first section. Once you scroll down, it works fine, but on the first section, this issue persists. You can check out the problem here. Simply redu ...

Animate the jQuery: Move the image up and down inside a smaller height container with hidden overflow

Check out the fiddle to see the animation in action! The image is programmed to ascend until its bottom aligns with the bottom of the div, and then descend until its top aligns with the top edge of its parent div, revealing the image in the process. ...

Utilizing the power of JSF ajax with Bootstrap's data-toggle feature for radio buttons

Despite my efforts, I have not been able to find a definitive answer on SO. If this question has already been addressed, please point me in the right direction. This is what I currently have: (HTML) <span class="btn-group" data-toggle="buttons-radio" ...