Suppose there are two divs, A & B.
Div B has been given a width of 900px;
Screen resolution is 500px;
这将导致横向发展。
问题在于我走向正确的时候,我认为,离婚并非100%。
我是否能够使《离婚法》永远填补剩余的空间?
see the image,
为了解释问题,添加以下形象:
Suppose there are two divs, A & B.
Div B has been given a width of 900px;
Screen resolution is 500px;
这将导致横向发展。
问题在于我走向正确的时候,我认为,离婚并非100%。
我是否能够使《离婚法》永远填补剩余的空间?
see the image,
为了解释问题,添加以下形象:
原文照发:<0>。
和
body{
min-width:900px; // total width of your wraper as like wraper width
}
i 认为你没有浮标:离异
.DivA{
float: left
width: 100%
}
If you use the CSS3 -webkit-box-flex property it will help. But the problem is, it wont work on all the browsers.
您仅可使用<代码>width:<100%/代码>。 它将填补空白空间。 此外,添加<条码>float:left;职位:relative,用于两个条块。
The problem is: the div container is not expanding over the window width... the divA has autowidth, so it will expand to the container width, the grid div has a min-width greater than the window width (i think... can t see it in the code)
我的回答是:
Html:
<h1>Child Expand Test</h1>
<form action="#">
<div class="divContainer">
<div class="divA">
</div>
<div class="divGrid">
</div>
</div>
</form>
CSS: form { /* just to show the form doesn t expand, if you need expand it / / move the answer line to this class */ background-color: silver; padding-top: 1em; padding-bottom: 1em; }
.divContainer {
display: inline-block; /* this is the answer line, to expand over the window width */
}
.divA { /* this div will expand over the window width */
background-color: red;
}
.divGrid {
background-color: blue;
min-width: 1500px; /* This is the reason why its needed, yo expand one child width over the size of the window */
}
http://jsfiddle.net/bjb7drdm/“rel=“nofollow” http://jsfiddle.net/bjb7drdm/。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
display: grid;
grid-template-columns: 1fr;
}
.container {
display: grid;
grid-template-columns: 1fr auto;
}
.divA {
background-color: lightblue;
/* Optional styling for divA */
}
.divB {
width: 900px;
background-color: lightcoral;
/* Optional styling for divB */
}
</style>
</head>
<body>
<div class="container">
<div class="divA">
A
</div>
<div class="divB">
B
</div>
</div>
</body>
</html>
you can make Div A always fill the remaining space by using CSS Flexbox or CSS Grid, which are both layout models in CSS that can help you achieve flexible and responsive designs. Here s an example using Flexbox:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
margin: 0;
}
.container {
display: flex;
flex-wrap: wrap;
}
.divA {
flex: 1;
background-color: lightblue;
/* Optional styling for divA */
}
.divB {
width: 900px;
background-color: lightcoral;
/* Optional styling for divB */
}
</style>
</head>
<body>
<div class="container">
<div class="divA">
<!-- Content of Div A -->
</div>
<div class="divB">
<!-- Content of Div B -->
</div>
</div>
</body>
</html>
I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....
I have a div <div id="masterdiv"> which has several child <div>s. Example: <div id="masterdiv"> <div id="childdiv1" /> <div id="childdiv2" /> <div id="...
I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...
<form><input type="file" name="first" onchange="jsFunction(2);"> <input type="file" name="second" onchange="jsFunction(3);"</form> Possible to pass just numbers to the js ...
So I ve got a menu with a hover/selected state and it loads fine in IE6/IE7. However when I scroll down the page and put the element outside of the viewport and then back in I get a broken image! I ...
I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!