Div behave incorrectly when “<select>” is used; works fine when “<input>” is used - html

I have code as shown in http://jsfiddle.net/Lijo/PJcZQ/. It has tow divs with similar content “GROUP1” and “GROUP2” – only difference being the following
GROUP 1
<div class="secondTextBox">
<select name="ctl00$detailContentPlaceholder$ddlStatus" id="detailContentPlaceholder_ddlStatus" class="dropdownItem" style="width: 120px;">
</select>
</div>
GROUP 2
<div class="secondTextBox">
<input name="ctl00$detailContentPlaceholder$txtVal2" type="text" id="detailContentPlaceholder_txtVal2" style="width: 120px;" />
</div>
CSS
.searchValuesDiv
{
padding: 10px 0 0 20px;
margin:20px 0 20px 0px;
border:1px solid Cyan;
overflow:auto;
}
Group 1 is not behaving as expected – the div containing the button starts from a wrong position.
Note: This issue is not reproducible while seeing from jsFiddle. This can be reproduced when a HTML page is created with that code.
Why is it behaving so? [Can you explain why it was not a problem when I used "Input" element?]
How can we correct it?

You seem to be using floats. If you want the .btnSearchDiv element to start in a “new line”, just add a overflow: hidden; to the .searchLine elements. Without that, those elements are collapsed because they contain floating elements.

There is a missing float in the .searchLine.. I hope it fix your problem
Change the css to this:
.searchLine
{
float:left;
width:auto;
min-width:700px;
height:auto;
margin:1px 1px 1px 1px;
padding: 0 0 0 0px;
}
or
.searchLine
{
clear:both;
width:auto;
min-width:700px;
height:auto;
margin:1px 1px 1px 1px;
padding: 0 0 0 0px;
}

Related

Need to set "display; none" with CSS for placeholder <div class="sticky-element-placeholder sticky-element-active"

Wordpress - Elementor. Trying to optimize code something went wrong and now I got this giant empty space above my first section on the page that I'm trying to get rid of. I'm a newbie and using Elementor so I only have the custom css to work with. The problem manifests on tablet and mobile, not desktop.
<div class="sticky-element-placeholder sticky-element-active" style="display:flex; float:none; flex:0 1 auto; box-sizing:border-box; clear:none; overflow:visible; transform:none; width:448.09722900390625px; height:3277.34716796875px; margin:0px 0px 0px 0px;"></div>
I've tried targeting the following without any success.
.sticky-element-placeholder.sticky-element-active {
display: none
}
<div class="sticky-element-placeholder sticky-element-active" style="display:flex; float:none; flex:0 1 auto; box-sizing:border-box; clear:none; overflow:visible; transform:none; width:448.09722900390625px; height:3277.34716796875px; margin:0px 0px 0px 0px;"></div>
use important to your style.
.sticky-element-placeholder.sticky-element-active {
display: none!important;
}

How do I incorperate a line break in a web app? (HTML,CSS)

So I have been researching this for the past 10 or so minutes and am now bringing it to this community. I don't know how to make a break like this:
I know there used to be an "hr" tag like so, but its depreciated and I'd prefer to use something else. Its a common thing for login pages where its Email login "or" login with a social account. If you have any tips or find anything, please link it down below!
Thanks in advance!!
I personally would use an HR with confidence, but if I didn't want to use HRs I'd try something like this, using the :after selector.
p {
text-align: center;
}
p span {
background-color: #fff;
display: inline-block;
padding: 0 3px;
}
p:after {
content: '';
display: block;
border-bottom: 1px solid black;
margin-top: -8px;
}
<p><span>or</span></p>
The <hr> is not deprecated.
In HTML5, the <hr> tag defines a thematic break.
In HTML 4.01, the <hr> tag represents a horizontal rule.
However, the <hr> tag may still be displayed as a horizontal rule in visual browsers, but is now defined in semantic terms, rather than presentational terms.
All the layout attributes are removed in HTML5. Use CSS instead.
For more check https://www.w3schools.com/tag_hr.
An alternative would be to use for example <div>s and borders (check the snippet):
.thisIsFormContainer
{
position:relative;
float:left;
border:1px solid #000;
border-radius:4px;
text-align:center;
padding:20px;
}
.top
{
position:relative;
width:90%;
margin:0px auto 10px auto;
padding:0;
border-bottom:1px solid #09f;
}
.fieldGroup
{
position:relative;
width:90%;
margin:0px auto 0px auto;
padding:0;
text-align:left;
}
.item
{
position:relative;
}
<div class="thisIsFormContainer">
<div class="top">
<div class="item">Send us an email!</div>
</div>
<div class="fieldGroup">
<div class="item">Address:</div>
<div class="item">Country:</div>
</div>
<div class="fieldGroup">
<div class="item">State:</div>
<div class="item">City:</div>
</div>
</div>

How to avoid overlaying shadow in one side in CSS3

I am trying to set shadow effect for a content and i can be able to set it. But i overlays with adjacent element which disturbs the look. Is there any possible way to remove the overlaying effect for specific area(in the red circle in image)? Pleas check the sample image below.
HTML:
<div id="container">
<div id="table1">
<table>
<tr><td>AAA</td></tr>
<tr><td>BBB</td></tr>
<tr><td>CCC</td></tr>
</table>
</div>
<div id="table2" class="Shadow">
<table>
<tr><td>aaa</td><td>eee</td></tr>
<tr><td>bbb</td><td>fff</td></tr>
<tr><td>ccc</td><td>ggg</td></tr>
<tr><td>ddd</td><td>hhh</td></tr>
</table>
</div>
</div>
CSS:
#container {
position: relative;
}
table,td,tr{
border:1px solid black;
}
#table1{
position: absolute;
}
#table2{
position:absolute;
background-color:pink;
margin-left:40px;
}
.Shadow{
-webkit-box-shadow: 0 0 30px 9px #476FCC;
box-shadow: 0 0 30px 9px #476FCC;
}
JS Fiddle link: http://jsfiddle.net/5JYPm/13/
I think the closest you are going to get is stacking the first table over the second, and ensuring you have a background colour on it:
#table1{
position: absolute;
z-index:2;
background-color:#fff;
}
#table2{
position:absolute;
background-color:pink;
margin-left:40px;
z-index:1;
}
http://jsfiddle.net/5JYPm/16/
you need to change the z-indexs of the tables and then add a background-color to table1
Example
Adjust the box-shadow to the right about half the spread?
.Shadow{
box-shadow: 15px 0 30px 0px #476FCC;
}
JSfiddle
<div id="table2" style="z-index:-1;" class="shadow">

div jumps out of header with short names

Working on a website where I am thinking to make the name as a variable to show who is logged in but the problem is that the log out buttom goes out of the header when the name is short as Petter, but stays inside when the name is long as Petter Hansen. Is it a solution to make the buttom stay at same position independent of the name size?
jsfiddle: http://jsfiddle.net/85tU2/
Try this: http://jsfiddle.net/85tU2/2/
I've tidied up a few things - basically, moved the divs around because you are using float:right. Your code was using margins to move the button to the right of the name. So in the css, I've done this:
#formtekst {
position:relative;
float: right;
margin: 1px 0px 0px 0px;
background:#ccc;
}
#form-group {
position:relative;
float:right;
margin:15px 0px 0px 0px;
background:#ddd;
}
And for the html:
<div id="logo">
<img id="logo" src="NIH.gif" alt="logo" />
</div>
<div id="form-group">
<button type="button" class="btn">Logg ut</button>
</div>
<div id="formtekst">
<p>Logged in as Petter</p>
</div>
Hey ,
you can just easily change the styles for the #formtkst to this
#formtekst {
float: right;
margin: 1px 15% 0px 0px;}

Display settings to make images take up a whole line of a div

I've got some CSS that looks like
.drugCard
{
width:280px;
height:375px;
border: 10px solid;
padding: 10px 10px 10px 10px;
margin: 10px 10px 10px 10px;
text-align:center;
float:left;
}
.drugCard span
{
display:block;
border-bottom:2px solid #ccc;
font-size:xx-large;
}
.drugCard img
{
padding:2px 2px 2px 2px;
border: 1px solid black;
clear:both;
display:inline-block;
}
with output that looks like
You can see in the right picture were there are three pictures the date is present at the bottom of the pictures. This is because those three pictures fill up the div completely. What CSS do I need to make the date always appear on a new line?
These are .NET-generated controls so I would prefer a one-liner CSS if there is one vs. manually editing the HTML. Currently the date you see is added as literal text to the page.
EDITED to add markup:
<div class="drugCard" style="border-color:Chocolate;">
<span>BISCOLAX</span><img src="Images/Nausea.jpg" style="height:75px;width:75px;" />11/19/2012 12:00:00 AM
</div><div class="drugCard" style="border-color:DarkOrange;">
<span>RENAGEL</span><img src="Images/Pain.jpg" style="height:75px;width:75px;" /><img src="Images/Sleepiness.jpg" style="height:75px;width:75px;" /><img src="Images/UpsetStomach.jpg" style="height:75px;width:75px;" />11/9/2012 12:00:00 AM
</div><div class="drugCard" style="border-color:MediumAquamarine;">
<span>VYVANSE</span><img src="Images/Sleepiness.jpg" style="height:75px;width:75px;" /><img src="Images/Fever.jpg" style="height:75px;width:75px;" /><img src="Images/Nausea.jpg" style="height:75px;width:75px;" />1/29/2013 12:00:00 AM
</div>
Put a around your date value and set its clear value to both in css.
HTML:
<span class="date">11/9/2012 12:00:00 AM</span>
CSS:
.date{
clear: both;
}
P.S.: As you have already set some of the properties of span when you used it for titles, you need to clear those properties for your time element OR use any other element instead of span.
Without knowing what your markup looks like, you need to use clear: both; on your date element.
Clear will push the cleared element below any floats that precede it in the markup.