How to add an image to a CSS popup box - html

<div class="showUserInfo noPrint" id="showUserInfo">
<div class="hidOverflow brClear fullWidth vertAlignT allAroundPad">
<div class="setFloatL hidOverflow vertAlignT" style="width: 55%;">Login User: </div>
<div class="setFloatL hidOverflow vertAlignT" style="width: 45%; color: #FFF;"><asp:Label ID="lblUserN" runat="server" ClientIDMode="Static" /></div>
</div>
<div class="hidOverflow brClear fullWidth vertAlignT allAroundPad">
<div class="setFloatL hidOverflow vertAlignT" style="width: 55%;">Workgroups: </div>
<div class="setFloatL hidOverflow vertAlignT" style="width: 45%; color: #FFF;">
<ul class="ulO" id="ulO" runat="server">
</ul>
</div>
</div>
<div class="hidOverflow brClear fullWidth vertAlignT allAroundPad" id="dvAdmin" runat="server">
<div class="setFloatL hidOverflow vertAlignT" style="width: 55%;">Admin Status: </div>
<div class="setFloatL hidOverflow vertAlignT" style="width: 45%; color: #FFF;"><asp:Image runat="server" ID="imgIsAdmin" ClientIDMode="Static" ImageUrl="~/theImages/admin_yes.png" CssClass="adminImg" /></div>
</div>
</div>
CSS:
.showUserInfo {
position: absolute;
background: #243942;
border: 4px solid #E55302;
overflow: hidden;
right: 45px;
min-height: 100px;
width: 350px;
top: 55px;
z-index: 200;
text-align: left;
padding: 10px;
color: #C0C0C0;
display: none;
}
Output:
I am looking to add an image to the left corner which goes outside of the box to look something like this:
I tried to change the HTML to the following but the image goes inside the box:
<div class="showUserInfo noPrint" id="showUserInfo">
<div class="hidOverflow brClear fullWidth vertAlignT allAroundPad">
<div class="setFloatL hidOverflow vertAlignT" style="width: 55%;">Login User: </div>
<div class="setFloatL hidOverflow vertAlignT" style="width: 45%; color: #FFF;"><asp:Label ID="lblUserN" runat="server" ClientIDMode="Static" /></div>
</div>
<div class="hidOverflow brClear fullWidth vertAlignT allAroundPad">
<div class="setFloatL hidOverflow vertAlignT" style="width: 55%;">Workgroups: </div>
<div class="setFloatL hidOverflow vertAlignT" style="width: 45%; color: #FFF;">
<ul class="ulO" id="ulO" runat="server">
</ul>
</div>
</div>
<div class="hidOverflow brClear fullWidth vertAlignT allAroundPad" id="dvAdmin" runat="server">
<div class="setFloatL hidOverflow vertAlignT" style="width: 55%;">Admin Status: </div>
<div class="setFloatL hidOverflow vertAlignT" style="width: 45%; color: #FFF;"><asp:Image runat="server" ID="imgIsAdmin" ClientIDMode="Static" ImageUrl="~/theImages/admin_yes.png" CssClass="adminImg" /></div>
</div>
<img src="../theImages/preloader_small.gif" style="position: absolute; left: -22px; top: -22px;" />
</div>

You do this using position values and negative positions.
See the jsfiddle
.box {
position: relative;
}
.image {
position: absolute;
top: -30px;
left: -30px;
}
And the important part of the example in the code above. The .box is position: relative; - the image (which could be any HTML element of course) is position: absolute; and the absolutely positioned element can then be positioned using top, left, right, bottom or z-index properties exactly where you want it. You might need z-index if something else was overlaying it to ensure it is on top.
Position absolute always positions the element at co-ordinates relative to the next item up the DOM tree where the position is set to relative or absolute, meaning that the position will remain set regardless of how the internal .box HTML changes. These co-ordinates default to 0x and 0y.

Related

How to overlap one div on another div using HTML and CSS

I tried z-index :-1 and position:absolute both didn't worked.
How to fix issue.
Are there any other alternatives for overlapping.
<div *ngIf="allFiltersData.length > 0">
<div style="width: 100%;">
<div id="{{controls.fieldName}}_Text" style="border-style: groove;font-style: 14px;border-radius:3px;height: 100%;word-wrap: break-word;padding-left:10px;padding-top:4px;padding-bottom: 4px;font-size: 14px;color:#333333;vertical-align: middle;" tabindex=0 (click)="showList(controls.fieldDisplayName)" class="accordion">Select {{controls.fieldDisplayName}}</div>
<div name='htmlMultiSelect' style="overflow:auto;border-style: groove;width: 300px;background-color: white; position: absolute;height:auto;max-height: 200px; white-space: nowrap;display: none;" id="{{controls.fieldDisplayName}}">
<div style=" padding-left: 10px;padding-top: 10px;padding-bottom: 20px;">
<input type="checkbox" (click)="selectAllForMultiSelect(controls,$event,tab.name)" style="width: 20px;height: 20px;vertical-align:middle;" id="{{controls.fieldName}}_SelectAll">
<input name="{{controls.fieldName}}" (keypress)="multiSelectSearch($event,tab.name,controls)" id="{{controls.fieldDisplayName}}_{{tab.name}}_Search" style="width: 200px;height: 30px;vertical-align:middle;" type="text">
</div>
<div name="customMultiSelectItems" style="padding-top: 5px;padding-left: 10px;" *ngFor="let val of fetchFilterValues(controls.fieldName,true)">
<input type="checkbox" (click)="setSelectedData(controls.fieldControlType, controls.fieldName, {id:val.value.id,name:val.value.name},controls.dependentFilterName,$event,controls.fieldDisplayName,tab.name)" style="width: 20px;height: 20px;vertical-align:middle;" id="{{val.value.id}}_{{controls.fieldName}}_{{tab.name}}" name={{val.value.name}}_{{controls.fieldName}}_{{tab.name}}>
<label tabindex=0 style="font-size:14px;color: #333333;vertical-align:middle;" for={{val.value.id}}_{{tab.name}}> {{val.value.name}}</label>
</div>
<br>
</div>
</div>
</div>
<div id="OverlapThisSection" style="position:absolute">
<div>
</div>
</div>
I'm using above code.
Div with id OverlapThisSection needs to be overlapped. I had set Div with name htmlMultiSelect to position:absolute
Div with id OverlapThisSection not getting overlapped by another Div above to it.
Update 1:
Currently I'm getting view as below.
Actually I'm using primeng dropdown inside OverlapThisSection div.
<p-dropdown> not getting overlapped by it's top div.
How to fix this issue.
I see this 2 different divs, so you can use position:absolute; and top:20px; to the second div.
#OverlapThisSection {
margin: 10px;
position: absolute;
top: 30px;
background-color: green;
}
<div *ngIf="allFiltersData.length > 0">
<div style="width: 100%; height:50px;">
<div id="{{controls.fieldName}}_Text" style="border-style: groove;font-style: 14px;border-radius:3px;height: 100%;word-wrap: break-word;padding-left:10px;padding-top:4px;padding-bottom: 4px;font-size: 14px;color:#333333;vertical-align: middle;" tabindex=0
(click)="showList(controls.fieldDisplayName)" class="accordion">Select {{controls.fieldDisplayName}}</div>
<div name='htmlMultiSelect' style="overflow:auto;border-style: groove;width: 300px;background-color: white; position: absolute;height:auto;max-height: 200px; white-space: nowrap;display: none;" id="{{controls.fieldDisplayName}}">
<div style=" padding-left: 10px;padding-top: 10px;padding-bottom: 20px;">
<input type="checkbox" (click)="selectAllForMultiSelect(controls,$event,tab.name)" style="width: 20px;height: 20px;vertical-align:middle;" id="{{controls.fieldName}}_SelectAll">
<input name="{{controls.fieldName}}" (keypress)="multiSelectSearch($event,tab.name,controls)" id="{{controls.fieldDisplayName}}_{{tab.name}}_Search" style="width: 200px;height: 30px;vertical-align:middle;" type="text">
</div>
<div name="customMultiSelectItems" style="padding-top: 5px;padding-left: 10px;" *ngFor="let val of fetchFilterValues(controls.fieldName,true)">
<input type="checkbox" (click)="setSelectedData(controls.fieldControlType, controls.fieldName, {id:val.value.id,name:val.value.name},controls.dependentFilterName,$event,controls.fieldDisplayName,tab.name)" style="width: 20px;height: 20px;vertical-align:middle;"
id="{{val.value.id}}_{{controls.fieldName}}_{{tab.name}}" name={{val.value.name}}_{{controls.fieldName}}_{{tab.name}}>
<label tabindex=0 style="font-size:14px;color: #333333;vertical-align:middle;" for={{val.value.id}}_{{tab.name}}> {{val.value.name}}</label>
</div>
<br>
</div>
</div>
</div>
<div id="OverlapThisSection" style="position:absolute">Second div content
<div>
</div>
</div>
Or another simple example, you don't have to use z-index for this:
.first {
height: 100px;
width: 100px;
background-color: red;
}
.second {
margin: 10px;
position: absolute;
top: 10px;
height: 80px;
width: 80px;
background-color: green;
}
<div class="first">
</div>
<div class="second">
</div>

Why my interface look differently in browser and google device toolbar?

my interface in Google chrome browser (Is normal, I set it like this)
But when I click the inspect and click google device toolbar, the interface look like:
.btn {
position: absolute;
top: 85%;
left: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
}
.div_hover {
background-color: #F9F7F2;
}
<div style="width: 80%; margin: auto;">
<div class="div_hover" style="width: 473px; height: 200px; margin: auto;">
<p style="font-size: 18px;">Dear Customer</p>
<hr>
<p style="font-size: 11px">Welcome.......</p>
<hr>
<p style="font-size: 11px">bla..bla...</p>
<hr>
</div>
<div style="width: 49%; margin: auto; position: relative;">
<img src="https://www.rspcasa.org.au/wp-content/uploads/2019/01/Adopt-cat-mobile-banner-600x300-fit-constrain-q70-mobile_banner_image.jpg">
<form action="https://www.google.com/">
<input type="image" src="https://www.freepngimg.com/thumb/download_now_button/25399-6-download-now-button-thumb.png" class="btn" />
</form>
</div>
</div>
How can I make it both same?
Well, you are currently setting the div have the width of 49% but <img> doesn't have any width set. That is causing the image to be its original size. If you want to display the image in the same way for different screen width, you should do something like this:
<div style="width: 80%; margin: auto;">
<div class="div_hover" style="width: 473px; height: 200px; margin: auto;">
<p style="font-size: 18px;">Dear Customer</p>
<hr>
<p style="font-size: 11px">Welcome.......</p>
<hr>
<p style="font-size: 11px">bla..bla...</p>
<hr>
</div>
<div style="width: 473px; margin: auto; position: relative;">
<img width="100%" src="https://www.rspcasa.org.au/wp-content/uploads/2019/01/Adopt-cat-mobile-banner-600x300-fit-constrain-q70-mobile_banner_image.jpg">
<form action="https://www.google.com/">
<input type="image" src="https://www.freepngimg.com/thumb/download_now_button/25399-6-download-now-button-thumb.png" class="btn" />
</form>
</div>
</div>
As you see, don't give the custom width to the second child div. If you have to give the width as 49% for second div, then give the width for <img> as well.
https://jsfiddle.net/2epL85r1/

HTML5 Forms Action bahavior

Okay I'm trying to pass parameters like this link here using form tag in HTML
https://pyramisaegypt.seebooking.com/#/booking-engine/room-list?property_id=445586&checkin=2018-11-22&checkout=2018-11-23&noOfAdults=1&noOfChildren=1&noOfRooms=1&promo_code=
but for some reason it always becomes this after i hit submit
https://pyramisaegypt.seebooking.com/?property_id=445586&checkin=2018-11-22&checkout=2018-11-23&noOfAdults=1&noOfChildren=1&noOfRooms=1&promo_code=#/booking-engine/room-list
Notice that whatever is after the hash and behind the question mark gets transferred at the end of the url
The page url is http://pyramisaegypt.com/test-page/
My code is
<form id="reservation-widget-wrap-form-element" style="background-color: #f0f0f0; color: #777; padding: 10px; padding-right: 5px; margin-bottom: 20px;" action="https://pyramisaegypt.seebooking.com/#/booking-engine/room-list" method="get" target="_blank">
<div id="children-wrap" style="width: 20%; display: inline-block">
<div class="caption">Hotels</div>
<p><select id="reservation-widget-hotels" style="width: 100%;height: 32px;padding-left: 5px;margin-bottom: 0px;" name="property_id"><option value="547027">Pyramisa Cairo Suites Hotel</option><option value="568389">Pyramisa Sahl Hasheesh Resort</option><option value="31070">Pyramisa Sharm El Sheikh Resort</option><option value="35520">Pyramisa Isis Luxor Resort</option><option value="445586">Pyramisa Isis Island Aswan Resort</option><option value="450628">Pyramisa Isis Corniche Aswan Resort</option></select></p>
</div>
<div id="check-in-wrap" style="display: inline-block; /* background: white;">
<div class="caption">Check-in date</div>
<p><input id="reservation-widget-checkin" class="hasDatepicker" style="width: 125px;height: 50%;" name="checkin" type="date"></p>
</div>
<div id="check-out-wrap" style="display: inline-block; padding: 5px;">
<div class="caption">Check-out date</div>
<p><input id="reservation-widget-checkout" class="hasDatepicker" style="width: 125px;height: 50%;" name="checkout" type="date"></p>
</div>
<div id="adults-wrap" style="display: inline-block;">
<div class="caption">Adults</div>
<p style="width: 100px;"><select id="reservation-widget-adults" style="display: inline-block; width: 121.4px; height: 50%;" name="noOfAdults"><option value="1">1</option><option value="2">2</option></select></p>
</div>
<div id="children-wrap" style="display: inline-block;padding: 5px;width: 100px;">
<div class="caption">Children</div>
<p style="
width: 100px;
"><select id="reservation-widget-children" style="display: inline-block; width: 121.4px; height: 50%;" name="noOfChildren"><option value="0">0</option><option value="1">1</option><option value="2">2</option></select></p>
</div>
<div class="caption">Number of Rooms</div>
<p style="
width: 100px;
"><select id="reservation-widget-children" style="display: inline-block; width: 121.4px; height: 50%;" name="noOfRooms"><option value="0">0</option><option value="1">1</option><option value="2">2</option></select></p>
</div>
<div id="children-wrap" style="display: inline-block;padding: 5px;width: 100px; margin-left: 1%;">
<div class="caption">Promo Code</div>
<p style="width: 100px;">
<input type="text" style="width: 100%;" name="promo_code">
</p>
</div>
<p style="display: inline-block; width: 20%; margin-bottom: 0px; margin-left: 2%;"><button id="submit-button" type="submit" style="
background: #b01c30;
width: 90%;
border-radius: 6px;
height: 35px;
border: none;
">Online Reservation</button></p>
</form>
i tried every solution out there to change the behavior of the hash in the action of the form but nothing seemed to be working so far.
Perhaps you should look at how a URL is formed. Anything after a # is not sent to the server as it refers to an anchor on the page. Therefore a "GET" form will always strip out those bits.

CSS bring two different font sizes in one line

How do I both bring the "July" and the "2016" in the line, with the font-size differences and the "2016" being aligned right?
<div style="position: relative; width: 10%">
<span style="font-size: 14px">July</span><span style="font-size: 20px; right: 0; position: absolute;">2016</span>
<hr style="margin-top: 5px;">
</div>
Do you mean they should be aligned the same way? You can use vertical-align: bottom to get them aligned on the line, or middle to align them centered with each other.
<div style="position: relative;display:inline-block;">
<span style="font-size: 14px;display:inline-block;vertical-align:bottom;">July</span> <span style="font-size: 20px; display:inline-block;vertical-align:bottom;">2016</span>
<hr style="margin-top: 5px;">
</div>
remove:
position: absolute;
top:0;
Replace it by:
float: right;
Fiddle
HTML
<div style="position: relative; width: 25%">
<span style="font-size: 14px">July</span><span style="font-size: 20px;float:right;">2016</span>
<hr style="margin-top: 5px;">
</div>

Side by side divs w/ negative relative position

I'm trying to create two side by side divs in a wrapper. The first div, #content, is a position:relative div.
#wrapper {
background-image: url(assets/images/BG2.gif);
margin-right: auto;
margin-left: auto;
width: 996px;
overflow: auto;
}
#content {
position: relative;
top: 10px;
left: 10px;
width: 745px;
background-color: red;
}
#important {
float: right;
position: relative;
top: -1120px;
width: 231px;
margin-right: 10px;
background-color: green;
}
The problem is that the second div, #important, is displayed under the first one. There is enough space for both divs and the padding/margins. I can make it work by floating it to the right and using a negative top position and it displays fine, but I feel as though there is a better/correct way of doing this.
HTML:
<div id="wrapper">
<div id="content">
<img src="assets/photos/bid day 046.jpg" alt="Bid Day" width="745" height="311" />
<div id="fraternity">
<p align="center"><span class="style5"><strong>TITLE</strong><br />
Subtitle<br />
Sub-subtitle</span></p>
<p align="justify">depry derp</p>
<p align="justify">derp derp derp</p>
<p class="style5" align="center"><br/><strong>Title<br/>
Twitter Feed</strong></p>
<div id="twitter">
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>...</script>
</div>
</div>
<div class="fb-like-box" data-href="something" data-width="292" data-colorscheme="dark" data-show-faces="false" data-stream="true" data-header="false">
</div>
</div>
<div id="important">
<p align="center"><strong>IMPORTANT INFORMATION</strong><br />Derp!</p>
<img class="divider" src="assets/images/hr.gif" alt="HR" width="183" height="15" />
<p align="center"><strong>Achievements<br /></p>
<img class="divider" src="assets/images/hr.gif" alt="HR" width="183" height="15" />
<p align="center" class="style11"><strong>UPCOMING EVENTS<br /></strong>stuff<br /></p>
<p align="center"><br /> <strong>more stuff</strong><br /></p>
</div>
</div>
Make the #wrappers position be relative or absolute.
Then set the inner div positions to be absolute.
jsfiddle example: http://jsfiddle.net/kRHTj/
I would float them both left or right.