The div iframe is not showing up within the HTML document

The code snippet below shows a div with the left side displaying correctly, but the right side within an iframe is appearing outside of the boundary of the div. The content on the right is positioned at the top instead of being displayed within the space of the div.

HTML

<div id="details">
        <div id="left">
         <h2>Bangalore</h2>
    <img src="img/vcare_logo.png" width="100" height="83" alt="smoothy html5 template" hspace="50"/>
     <p><b><strong>rgd</b></strong><br>gf560032</p>
    </div>
   <div id="right">
   <h2>Upcoming News</h2>
<iframe id="NewsWindow" seamless src="news_win.htm" width="150" height="204" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" style="display: block; margin: 0 auto; padding: 0; border: #000000 1px solid;"></iframe>   
</div>
    </div>

CSS

#details  {   
  overflow:auto;
  width: 1050px;
  border: 1px solid black; 
  background: gray;
  margin: 2em auto;
}
#details h2{
  background-color: #A52A2A;
  color: #FFFFFF; 
  font: 13px arial, sans-serif;
  font-weight: bold; 
  text-align: center;
  padding: 3px;
}
#left, #right {
  width: 45%; 
  margin:5px; 
  padding: 1em;
  background: white;
}

#left {   
  float:left;

}
#right {   
  width: 158px; 
  border: #000000 1px solid; 
  background-color: #339999; 
  text-align: center; 
  padding: 0px 2px 7px 2px; 
  position: absolute; 
  visibility: visible; 
  left: 100px; 
  top: 100px; 
  z-index:3;
  float:right; 
}

Answer №1

To start, update your HTML code from

<p><b><strong>rgd</b></strong>
to
<p><strong><b>rgd</b></strong>
.

Next, modify the CSS for #right by changing it to float left and removing absolute positioning:

#right {
    width: 158px;
    border: #000000 1px solid;
    background-color: #339999;
    text-align: center;
    padding: 0px 2px 7px 2px;
    visibility: visible;
    left: 100px;
    top: 100px;
    z-index:3;
    float:left;
}

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

IE9 users are redirected to an ajax action when using Fancybox

I am currently experiencing an issue with using Fancybox in Magento admin, where everything works fine except for Internet Explorer 9. When I try to feed my fancybox by ajax, the link looks like this: <a class="fancybox fancybox.ajax" href="http://10.1 ...

Why does the AngularJS ngRepeat filter permanently remove null values?

Check out this JSFiddle demonstration I created to illustrate the problem: http://jsfiddle.net/s6Lj2/2/ Observe that in the dataset $scope.places = [{ name: 'Chicago', status: 'Active', analyst: 'Sam', recor ...

Verify whether the session has been initiated and establish a global variable that can be utilized by JavaScript

I currently have the following arrangement: main.php page.php Whenever a user visits any of these pages, they experience an "introductory header animation". However, I want to ensure that this animation is only displayed on their initial visit and not w ...

Tips for deactivating the highlight on a previously selected menu item when clicking on the next menu option in Angular.js

In my pages, I have a menu where the landing page menu is initially highlighted. However, when I move to the next menu, the previous landing page highlight remains instead of being removed while swapping the menu. I am using Angular.js and angular ui-route ...

Can you create asynchronous code or functions without using Web APIs at all?

Even though JavaScript is single-threaded, I can't help but wonder about a function that takes an unusual amount of time without any involvement from web APIs like this: console.log("start") function banana() { let bananaCount = 10; while (b ...

Utilizing MVC Razor and Ajax.BeginForm to dynamically update elements upon successful form submission

In my MVC search form, there is a date field that includes "-" and "+" buttons to navigate to the previous or next day, triggering a search each time. The issue I am facing is that when the -/+ button is clicked, it sends the current form data to the cont ...

The CSS container moves when navigating around the website

I've encountered an issue where the wrapper section of my site shifts left and right unpredictably when navigating to different pages. I would like to ensure that it stays fixed in place regardless of the page being accessed. You can view a visual rep ...

Invoke Wicket 6 code using Javascript and retrieve the result

I successfully implemented a way to call my Wicket 6 Java code from JavaScript using option A, as demonstrated in this example: However, I am now facing the challenge of finding examples for returning data from the Java side back to JavaScript. The genera ...

Switch the execution of the script by clicking on the button

My website has a script that hides the navigation when scrolling down and shows it again when scrolling up slightly. However, I need to disable this functionality on mobile when the hamburger menu button is clicked. How can I achieve this? Below is the cod ...

What is the best way to align product cards side by side instead of stacking them on separate lines?

I am currently working on a mock-up website for a school project. For this project, I am developing a products page where I intend to showcase the items available for sale. Although I managed to successfully copy a template from w3schools, my challenge lie ...

Is there a way to deliver information to a specific element on a client's HTML page?

My current project involves using Node.js to serve a webpage that collects user inputs and stores them in a mongodb server. The web page also displays these user inputs. I am trying to determine the best way to pass the user inputs from node.js to the < ...

Turning plain text into functional HTML using React.js

After receiving data from an API that includes HTML, I encountered an issue where the HTML tags were being transformed into strings instead of being rendered as actual HTML when displayed in my code. I've done some research and came across the dange ...

Encountered a 404 error while attempting to build and serve a Vue.js project using 'npm build' in Apache Tomcat

After setting up a Vue.js project, the configuration in the package.json file looks like this: "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": ...

Sending Image Data in Base64 Format with Ajax - Dealing with Truncated Data

My current challenge involves sending Base64 image data through ajax to the Server. I've noticed that sometimes all the pictures are successfully sent, but other times only a few make it through. Does anyone have suggestions on how to implement error ...

The HTML to PDF file converter API performs well in a local environment but encounters issues when deployed on node.Js, Express.Js, html-pdf, and Azure Web Services platform

I've developed an API that converts HTML to PDF, and it works flawlessly in my local environment but encounters issues when deployed on Azure app web services. During the process of generating the PDF, the request gets stuck and eventually times out, ...

Retrieving the previous value using JQuery's onChange event

Is there a way to retrieve the initial quantity value before it is changed with the onChange function in this code snippet? I'm encountering issues with the CSS while using this setup for an input box. You can view the problematic CSS here. Updating ...

Creating a Foldable Footer Inside a Card (Bootstrap)

I successfully created three blocks using the CARD class in bootstrap. Now, I am seeking to add a footer or a div to each card that allows for toggling "Show/Hide Details". Despite attempting 10 different methods, the cards keep breaking for some reason w ...

Retrieve user information from WordPress database and showcase it on a WordPress webpage

I am currently in the process of creating a WordPress website where I aim to showcase user profiles directly on the homepage by fetching data from the database as members create their profiles. Here's what I have accomplished so far: When someone reg ...

What steps do I need to take in order to send a tweet through

I apologize for the inconvenience... All I am trying to achieve is posting a tweet through the Twitter API. My intention is solely to post from my own twitter account associated with the developer account. I simply need an application that has a twitter ...

The integration of Meteor.js with an external Mongo database is causing issues with logging in to Mongo

In my project, I am using a meteor.js application along with mongo db (2.6). To create a user in mongo, I followed these steps: use meteor db.createUser( { user: "meteor", pwd: "password", roles: [ { role: "userAdmin", ...