issue when Internet Explorer is formatting text following an image

My website functions perfectly in Chrome and Firefox, but it's not rendering correctly in IE. I've fixed most of the bugs, but one issue remains unresolved. Currently, the image is displayed with the text bunched up next to it, while the table appears fine.

<div id="page">
            <div id="slider">
                <!-- Slider images go here -->
                <div id="PhotoSlider">
                    <ul class="bjqs">
                        <li><img src="images/test2.png"></img></li>
                        <li><img src="images/test1.png"></img></li>                        
                    </ul>
                </div>
            <script>                 
                $("#PhotoSlider").bjqs({
                    'height' : 286,
                    'width' : 1000,
                    'animationDuration' : 800,
                    'showMarkers' : true,
                    'useCaptions' : false,
                    'keyboardNav' : false,
                    'showControls' : false
                });
            </script>
            </div>
            <div id="content">
                <div class="box">
                    <h1>Welcome!</h1><br/>
                        <p></p>
                        <p></p>
                </div>  
            </div>  

            <div id="contentRight">
                <p></p>
                <p></p>
            </div>
            
            <div id="sidebar">
                <img align="left" src="images/kidsSmiling1.png"></img><br>
                <h2>Newsletter</h2>
                <p>Sign up for the latest news and special offers</p>
                <table>             
                    <tr>
                        <td>First Name<req>*</req>&nbsp;</td>
                        <td><input id="firstName" name="firstName" type="text" style="width:180"/>
                    </tr>
                    <tr>
                        <td>Last Name<req>*</req>&nbsp;</td>
                        <td><input id="lastName" name="lastName" type="text" style="width:180"/>
                    </tr>
                    <tr>
                        <td>Email<req>*</req>&nbsp;</td>
                        <td><input id="email" name="email" type="text" style="width:180"/>
                    </tr>
                </table>
                <p align="middle"><input align="middle" type="submit" value="Submit" onclick="save()"  style="width:65"></P>
                <p><req>*</req>&nbsp;Required fields</p>                
            </div>
            <br class="clearfix" />

            <div id="media">
                <img align="right" src="images/facebookLogo.png"></img> <img align="right" src="images/twitterLogo.png"></img>
            </div> 
        </div>
    </div>
    
    <div id="footer">
        Copyright &copy; 2012 Kaysville Dental | <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="35615a5a415d715a56655440597558465b1b565a58">[email protected]</a>?Subject=Customer Inquiry">Email Us</a> | Phone:(800) 376-2241 | 690 Main Street. Kaysville, Utah
    </div>

Unfortunately, I can't provide a live link as the site is only on localhost. The problem lies with the alignment of the image and text below it. The CSS code for this section is as follows:

#sidebar {
background: white;
padding: 0px 5px 0px 50px;
margin-left: 0;
border-right: 1px solid #C0C0C0 ;
float: left;
width: 312px;
}


#sidebar p {
font-size: 12px;
margin-bottom: 0.5em
}

#sidebar img{
margin-bottom: 1.5em;
}
#sidebar req {
font-size: 12px;
color: red;
}

#sidebar td{
padding: 0px 0px 10px 0px;
font-size: 14px;
}

#sidebar h2{
text-transform: uppercase;
}

#contentRight {
background: white;
padding: 0px 50px 0px 0px;
float: right;
width: 550px;
}

The "contentRight" division should be aligned to the right of the sidebar. The sidebar contains an image and a small form, while the content on the right side consists of just text.

Answer №1

Make sure to add closing td tags for the second cell in each row and remove the align="left" attribute from the img tag

Take a look at this example on http://jsfiddle.net/Y9yf8/1/

Answer №2

To implement the solution, apply float: left to the <img> tag first and then use float: left; width: 100%; on the <h2> tag...

Evidence of success can be found here: http://jsfiddle.net/Y9yf8/3/ =)

Alternatively, follow the advice provided by Huangism...

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

Retrieving Information from Website Components in JavaFX Web View

I am currently developing a Java FX program that loads a folder containing HTML/CSS/JS files with 3 different websites. While the websites are displaying correctly in the webview, I am looking for a way to capture user interactions, such as checkbox selec ...

Is there a way to locate multiple buttons on a webpage that have the same id and field name but varying values using selenium?

On my webpage, I am looking to interact with four submit buttons. All four buttons have identical Id and name attributes, with the only difference being their values. Is it possible to locate and handle these elements using Selenium WebDriver? (Consideri ...

Issue with data binding in file upload field

I am currently working on a project using Asp.Net Core MVC. In the model, there is a property called IFormFile. While using a basic input tag, everything works perfectly fine. However, when I tried to implement the file input plugin from this URL, the mode ...

Reset button for jQuery form to clear all inputted values

My form has a reset button that is supposed to clear all entered values, but it doesn't seem to be working properly. After checking the Firefox console tab for errors, I noticed an 'illegal character' error at the end of my jQuery script. C ...

Firefox Style for HTML input Range

I'm encountering a CSS issue with an input-range element: <input type="range" id="difficultSelect" max="3" min="1" value="2"/> Here is the CSS code I am using: -webkit-appearance: none; z-index: 102; width: 225px; height: 5px; margin-left: 95 ...

The issue with jqBootstrapValidation is that it fails to display customized data-validation-required-message

I'm attempting to implement jqBootstrapValidation, but I keep seeing the default message instead of my custom one. Could it be that I forgot to include a <div> here? <div class="control-group"> <div class="controls"> <div c ...

Damaged background in Bootstrap interface modal

https://i.stack.imgur.com/nTAnK.png Is there anyone who can assist me in identifying the issue causing the broken or irregular backdrop in the background of overlays or pop-ups? $scope.Modal = $modal.open({ animation: true, ...

Tips for implementing $setValidity with ng-if for the same field in Angular

Hey there, I'm currently facing an issue with using form.form_field.$setValidity on an ng-if tagged field. When testing out the code, I encountered the following error: angular.js:13642 TypeError: Cannot read property '$setValidity' of unde ...

Creating a Visual Loading Effect in HTML

My website's layout scheme gets lost if the page isn't fully loaded. I'm interested in implementing an animation that is tied to the loading progress, similar to a progress bar but without the visual element of a bar itself. One idea is to ...

Real-time Calculation and Validation of Input Field Totals Using JQuery with Modulus % Rules

Hello, I need assistance with validating my input fields to accept values that are divisible by certain numbers. The criteria are as follows: inputValue % 10 == 0; inputValue % 20 == 0; inputValue % 50 == 0; inputValue % 100 == 0; inputValue % 200 == 0; ...

Is there a way to resolve the header iframe bug?

UPDATE: Issue Resolved! If you encounter the same problem, use the following solution: Replace nav { position: fixed; width: 100%; } with nav { position: fixed; width: 100%; z-index: 10; } I am currently working on a responsive website design using Bo ...

Using PHPMailer to send an HTML page via email

I am attempting to email this HTML page using unlayer.com. I have tried using $mail->isHtml(true), ... msgHtml... but the email client keeps showing the code instead of the HTML page. Any suggestions on how to fix this? Here is my code: $sql = "SE ...

Is there a variance in window.innerWidth between Chrome and Firefox?

body, html { position:absolute; width:100%; height:100%; margin: 0; padding: 0; overflow: hidden; } When using window.innerWidth, there is a discrepancy between the values returned by Firefox and Chrome. Firefox return ...

Crafting a traditional timepiece with canvas

Trying to create an analog clock using canvas. I wrote some code but I'm struggling with adjusting the speed of the clock hands (hours, minutes, and seconds). When I run the app, the hands are spinning too fast and leaving lines all over the clock. Is ...

the recurring pattern of media conditions in every single column

Hello, I'm currently involved in a project where I have implemented media conditions for my columns using Sass. Here is the code snippet: // Mobile media - 320px width @mixin mobile{ @media only screen and (max-width:767px){ width: 300px; } } B ...

The submission of the form is not functioning correctly when triggered by JavaScript using a button

My website was designed using a CSS/HTML framework that has been seamlessly integrated into an ASP.NET site. Within a ContentPlaceHolder, I have implemented a basic login form. The unique aspect is that I am utilizing the onclick event of an image to subm ...

Tips for creating a vertical scrollbar within a row component

Is there a way to create a scrollable parent v-row with a child v-row overflowing with content so that I can nest another v-row inside the v-col and ensure it remains within the scroll element? <v-row> <v-col> <v-row> <p ...

Tips for ensuring v-tabs-items and v-tab-item fill height

I found an example that I am trying to follow at the following link: https://vuetifyjs.com/en/components/tabs#content <v-tabs-items v-model="model"> <v-tab-item v-for="i in 3" :key="i" :value="`tab-${i}`" > < ...

Is there a detailed HTML page specifically designed for CSS testing?

I am in search of sample code featuring the use of semantic HTML to test stylesheets. The version/doctype is flexible, but HTML5 would be preferable. By "comprehensive," I mean incorporating definition lists, forms, tables, and all other standard element ...

Smoothly automate horizontal scrolling using JavaScript

My programming journey involved creating a code snippet that automatically scrolls paragraphs horizontally, giving it the appearance of "Breaking News" updates on popular websites. The Javascript script I implemented performs automatic scrolling, but once ...