When resizing the browser or changing resolution, one div may cover another div

After generating the HTML on my ASP.NET page, everything looks good initially. However, I noticed that when I adjust the screen resolution or reduce the browser size, the image in the logoplace div starts to overlap. It appears to be an issue with absolute positioning within the companyviewdiv.

<div id="content">
    <div class="main">
    <table>
        <tr>
            <td valign="top" class="Mid_row">
                <div class="indent">                            
                    <div class="logoPlace">
                        <img width="200" height="172" border="0" src="images/aldagi.jpg">
                    </div>  
                    <div class="comapanyView">
                        <table width="100%" cellspacing="0" cellpadding="0" border="0">
                            <tbody><tr>
                                <td colspan="2">
                                    <h1>heading</h1>
                                </td>
                            </tr></tbody>
                        </table>
                    </div>
            </td>
        </tr>   
    </table>
    </div>      
</div>  

Below are the relevant CSS classes:

.main {
    margin: 0 auto;
    max-width: 1200px;
    min-width: 997px;
    padding-left: 6px;
    text-align: left;
}

#content {
    background: url(/images/bg.gif) top left repeat-x #fff;
    overflow: hidden;
    padding-bottom: 20px;
}

.Mid_row {
    padding-right: 15px;
}

#content .indent {
    padding: 15px 0 0;
}

.logoPlace {
    margin-right: 20px;
    margin-top: 50px;
    position: absolute;
    right: 0;
    width: 15%;
}

.comapanyView {
    position: relative;
    width: 80%;
}

Answer №1

A little caution is necessary when using absolute positioning, but it shouldn't be a significant issue in this particular case. The problem seems to stem from the use of a % width on the logo div, so I suggest reconsidering or removing that:

.logoPlace {
    width: 15%; /* REMOVE THIS */
}

UPDATE: One solution for ensuring text wraps around the logo could involve moving the entire logo div inside the DescribRow div, like this:

<div class="DescribRow">
    <div class="logoPlace">
    <img border="0" src="images/aldagi.jpg" width="200" height="172">
    </div>

Then, remove the old logoPlace styles and replace them with the following:

.logoPlace {
    float: right;
    margin: -110px -20px 0 0;
}

You may need to adjust the positioning slightly, but it could be worth trying.

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

What is the best way to make an element disappear 5 seconds after the mouse has stopped hovering

#section1 { display: block; } #section2 { display: none; } #container:hover > #section2 { display: block; } <div id="container"> <div id="section1">Section1</div> <div id="section2">Section2</div> </div> ...

Using CSS styling to dictate how browsers display web content, specifically through setting font size measurements in EM

On different mobile devices and various browsers such as Internet Explorer and Mozilla, the font size in some divs does not appear consistent. Specifically, on a Samsung Galaxy S6. I am using EM units: I know it may not be ideal but I prefer this method a ...

Utilize Sass variables to store CSS font-size and line-height properties for seamless styling management

How can I save the font size and line height in a Sass variable, like so: $font-normal: 14px/21px; When using this declaration, I notice that a division occurs as explained in the Sass documentation. Is there a way to prevent this division from happening ...

Using React Redux to Calculate the Grand Total Price of all Products Added to Cart

<div className='container py-4 my-5'> {item.length === 0 ? ( <p> cart is empty, <NavLink to='/'>continoue shopping</NavLink> </p> ) : ( item.map((cart) => { return ( & ...

Trouble with setting HTML table width

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <table border="1" width="100%"> <tr> <td>bbbbbbbbbbbbbbbbbbbbbbbbbbb ...

Resize a responsive grid of images

Within my slider, I have three slides with 3 images each. The layout consists of one large image on the left and two smaller ones on the right. To ensure responsiveness, I've used max-width: 100% on the images so they can scale down proportionally as ...

Preview your uploaded image before finalizing

I am currently working on implementing a new upload feature for users of our forum. This feature will allow them to upload a personal picture. Here is what I have developed so far: HTML <label>Profile image</label> <div class="phot ...

show a different text when hovering over a table cell

I am working with a table where one column displays the employee ID, and I would like to show their names when hovering over it. Can someone assist me with this task? ...

Different ways to rearrange the placement of Export buttons in a personalized div or outside the table using Datatable

I would like to display the export buttons outside of the table. While searching on stackoverflow, I came across an example that uses the Select options method. You can find the example here. If anyone knows how to achieve this, please modify it and shar ...

How can I adjust the regular font size within a paragraph or link using bootstrap?

Looking at the fs-* classes can be very helpful, you can find them here: https://i.sstatic.net/l1Y22.png The issue I'm facing is that these classes only work for h1 to h6 headings, and not for smaller text. For example, I am unable to adjust the fo ...

Determining the repetition and placement of background images when employing multiple backgrounds

Is it possible to apply two background images to the same div? I want one image to repeat along the x-axis and the other to appear only once. I've tried using multiple background images, but I'm not sure how to target specific rules for each bac ...

Prevent Child Elements from Overstretching Container with Bootstrap Flex

I'm working on a layout where all elements can be viewed without the need for scrolling. Any panels that require more space should be scrollable. In the following example, I want the contents of main-left to be scrollable without stretching the entire ...

What is the best way to modify the color of the active tab I have chosen?

I've designed a tab menu using Divs and CSS, but I'm facing an issue with changing the color of the selected tab. I tried adjusting the background color of the .tab class, but it seems to only work for part of the tab... You can view the problem ...

Utilizing jQuery to modify the text output from an input form

Check out the preview site at . It's a test version before launching on a separate domain. Hello, I need to customize the error response for a CRM contact form integrated into Wordpress with the help of StackOverflow. The form is connected via JavaSc ...

Organize the columns and rows of a table using an array in PHP

I am using dompdf to generate my pdf document. Currently, I am facing a scenario where I need to create a table based on two queries from the database. Both of these queries return arrays. The first array contains 28 elements, while the second array cont ...

The GridCalendar view of FullCalendar v6.1 is generating 50 `ARIA attribute unsupported or prohibited` errors when analyzed with the SiteImprove browser extension

The Challenges Creating a website that adheres to accessibility laws can be quite daunting. I am currently using SiteImprove, a free browser extension, to check for any issues on my site. Unfortunately, the GridCalendar view is showing 50 errors. ARIA a ...

(Material UI version 5) Custom global style enhancements

One of the examples in MUI is the Global style overrides: const theme = createTheme({ components: { // Name of the component MuiButton: { styleOverrides: { // Name of the slot root: { // Some CSS fontSize ...

What is the process of incorporating a select form within a component?

I am currently working on creating a user registration form. Once the form is filled out and the submit button is clicked, I need the values from the form to be displayed in a specific <p id="data></p> component. Can anyone assist me with this ...

Customize scripts dynamically in Next.js based on the current environment during runtime

I need to dynamically insert a script into the <head> of my application, with the src attribute depending on a runtime environment variable from my hosting server (OpenShift). If process.env.ENVIRONMENT === "test", I want to add <script ...

What method can be used to incorporate Google Places API into a .js file without using a <script> element?

As I delve into the Google Places API documentation, I noticed that they require the API be loaded in this format: <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places"></script> Is ...