How to properly blur the required images - html

I am trying to blur just the image of the background, but it seems that the result that I am getting is blurring the whole div
My code is the following:
.profile-div {
background-image: url("http://2.bp.blogspot.com/_QtDFVR44S_Q/TTu95-aiCqI/AAAAAAAAA-k/jP65Ns2H-f0/s1600/camaleon2.jpg");
width: 100%;
height: 12em;
}
.img-profile {
height: 8em;
width: 8em;
border: 3px solid black;
margin-top: 2em;
margin-bottom: 2em;
}
<div class="profile-div scale-image img-blur">
<div class="form-group">
<input style="display: none" type="file" accept=".png,.jpg" (change)="uploadProfilePicture($event)" #fileInput />
<img *ngIf="imageURL" src="{{auxAuth.photoURL}}" class="pointer rounded-circle img-profile" (click)="fileInput.click()">
</div>
</div>
What I expected was to blur the img of the div background, but it is also blurring the inside img. How could I change that?
I show my current result:

Move the background image to a separate div, and wrap them both with a container:
HTML:
<div class="container-div">
<div class="profile-div scale-image img-blur"></div>
<div class="form-group">
<input style="display: none" type="file" accept=".png,.jpg" (change)="uploadProfilePicture($event)" #fileInput />
<img *ngIf="imageURL" src="{{auxAuth.photoURL}}" class="pointer rounded-circle img-profile" (click)="fileInput.click()">
</div>
</div>
CSS:
.profile-div, .container-div {
width: 100%;
height: 12em;
}
.profile-div {
//example blur
filter: blur(8px);
-webkit-filter: blur(8px);
}
.img-profile {
position: absolute;
top: 2em;
bottom: 2em;
height: 8em;
width: 8em;
border: 3px solid black;
}

Related

How to create facebook like loading skeleton using css?

i am new to creating animations...and i would like to create facebook like animation for loading the screen.
What i am trying to do?
i have a card and i want to represent the loading state by using the facebook like loading (skeleton screen with animation) for the div with class "image".
The code is added here
https://codepen.io/harika123/pen/vYEdoOY
Below is the code,
.container {
display: flex;
flex-direction: row;
}
.card {
box-shadow: 3px 3px 5px 0 rgba(0, 0,0, 0.15);
width: 309px;
position: relative;
top: 200px;
left: 250px;
}
.image {
display:flex;
width: 309px;
height: 176px;
background-color: #cccccc;
}
.loading {
position: relative;
top: 80px;
left: 125px;
width: 82px;
height: 20px;
background-color: white;
border-radius: 10px;
}
h4 {
height: 30px;
}
.text {
padding-left: 16px;
}
.footer {
display: flex;
width: 309px;
height: 72px;
background-color: white;
}
<div class="container">
<div class="card">
<div class="image">
<div class="loading">
<div class="text">loading</div>
<div class="button"></div>
</div>
</div>
<div class="footer">
<div class="info">
<h4>Card Name</h4>
</div>
</div>
</div>
</div>
I have tried to add the animations but is not working (look into code from codepen). how can i add the animations like the facebook loading skeleton screen. for facebook we see left to right shimmering effect. i want it to use 90 deg linear gradient. could someone help me with this. thanks.

Why is my search button below my search bar

I am making a search bar for an idea of mine and I'm still very new to CSS.
My search button is below my text bar and my on hover button and I can't figure out the solution or find the reason why!
I have tried changing the margins, padding, and top/bottom percentages but to no avail
HTML
<div class="search-box">
<div class="location">
<input name="location" type="text"
placeholder="location"/>
</div>
<div class="dropdwn">
<button class="dropbtn">dropdown</button>
<div class="dropdwn-content">
<img src="../Media/sunny.png" alt="Sunny"
width="50" height="50">
<img src="../Media/partly_cloudy.png"
alt="partly_cloudy" width="50"height="50">
<img src="../Media/rain_s_cloudy.png" alt="rain_s_cloudy"
width="50"height="50">
</div>
</div>
<div class="searchbtn">
<button type="button">Search</button>
</div>
</div>
CSS
.search-box
{
width: 40%;
box-sizing: border-box;
border-radius: 3px;
border-style: solid;
position: absolute;
left: 35%;
top: 20%;
}
.location input
{
box-sizing: inherit;
width: 50%;
float:left;
}
.dropdwn
{
position: relative;
display: inline-block;
}
.searchbtn button
{
float: right;
}
.dropdwn-content
{
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
I am expecting my searchbtn to be top right of the box instead of the bottom right
When using display: inline-block, the whitespace matters. This can mess up %-based layouts and indentation a bit (see below).
The other issue I see is with your rules around setting input width, as this will affect the child element instead -- telling it to fill 50% of .location instead of .search-box.
I've simplified your code to highlight these changes, and added some %'s so that the input and buttons will stretch (or shrink) to fill their parents, who will in turn fill .search-box. A simple float: right on the .searchbtn element now sends it to the right, without a new line.
* {
box-sizing: border-box;
}
.search-box
{
box-sizing: border-box;
border-radius: 3px;
border-style: solid;
left: 35%;
top: 20%;
width: 60%;
}
.search-box > div {
display: inline-block;
}
.search-box button, input {
width: 100%;
}
.location {
width: 50%;
}
.searchbtn {
float: right;
}
<div class="search-box">
<div class="location">
<input name="location" type="text" placeholder="location"/>
</div><div class="dropdwn">
<button class="dropbtn">dropdown</button>
</div><div class="searchbtn">
<button type="button">Search</button>
</div>
</div>

How do I insert a button in the middle of an image?

I want to place a search button in the middle of an image. But my button ended up at the bottom and outside of the image.
You can see live on www.emeupci.com
Here is my html code:
<div class="container-fluid headerimage">
<div class="col-md-12">
<img class="img-fluid" src="https://emeupci.com/static/users/img/map.png" alt="map" style="width: 100%;">
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn dropdown-toggle"
style=" border: 26px solid #f9f9f9;
cursor: pointer;
font-weight: bold; background-color: #447193;
color: white; padding: 8px; border-radius: 0px;
font-size: 16px;);">Search for a church</button>
<div id="myDropdown" class="dropdown-content">
<input type="text" placeholder="Search.." id="myInput" onkeyup="filterFunction()">
</div>
</div>
</div>
</div>
If you make your map a background image instead of an img element you can overlay your button on top of the image using this layout. The parent div needs to be relatively positioned and the button needs to be absolutely positioned within the parent div.
<div class="parent">
<div class="child">
button go here
</div>
</div>
.parent {
position: relative;
background: url("Images/") center no-repeat; /* <-- path to your map image here*/
background-size: cover;
width: 300px;
height: 500px;
}
.child { /*This class styles your button or your buttons container*/
position: absolute;
margin: 0 auto;
left: 0;
right: 0;
background-color: #abcf66;
bottom: 40px; /* adjust this to your liking*/
width: 80px;
height: 60px;
}

how to place text over an <input type = "image" /> element?

I can not write on over, I tried in several ways, but it still did not work, how do I do it?
I believe this is different because it is <input type="image"> and not <img> !
I want position the text on the image at the bottom
.centered {
position: absolute;
top: 95%;
left: 50%;
transform: translate(-50%, -50%);
color: red;
}
<div class="centered ">Example
<input type="image" id="MY_ID" src="img.png" class="btTxt submit " width="100" height="130" />
</div>
Don't try put an image on the input itself, use a wrapping div and add the image to that.
HTML
<div class="inputbutton">
<span class="text">Hello World!</span>
<input type="submit" class="btTxt submit" name="" value="">
</div>
CSS
div.inputbutton {
position: relative;
display: inline-block;
}
div.inputbutton input {
background: url('http://placehold.it/200x100') no-repeat;
cursor: pointer;
width: 200px;
height: 100px;
border: none;
}
span.text {
position: absolute;
bottom: 10px;
right: 10px;
}
JSFiddle:
https://jsfiddle.net/msyhoaak/18/

How to hover a span element using image sprite

I am wanting to use an image sprite for a hover action, but I've been working on it for an hour and can't get it right. The span element video-play-q-right has the sprite as its background.
Here is my sprite:
Here is a screenshot of the divs:
Here is the html:
<div class="video-box">
<div class="video-img">
<a href="#" onclick="window.open('http://url.html','photoessay','scrollbars=no,resizable=yes,width=800,height=600')">
<img src="resources-na/images/video.jpg" width="200" height="155" border="1">
<span class="video-play-q-right">play</span></a>
</div>
<div class="video-text">
<p><strong> of Water</strong>.<br /> water's properties. (05:43 min)
... View</p>
</div>
</div>
Here is the CSS:
.video-box{
padding-right: 20px;
float: left;
width: 200px;
}
.video-img {
background-color: #EEEEEE;
border: 1px solid #DDDDDD;
margin-bottom: 0 !important;
padding: 4px;
width: 200px;
height: 155px;
}
.video-play-q-right {
background: url("../images/video-play-q-big.png") no-repeat scroll 0 0 transparent;
background-position: center top;
height: 50px;
position: absolute;
text-indent: -9999em;
width: 50px;
left: 321px;
top: 127px;
}
a.video-play-q-right:hover span{
background-position: center bottom;
}
Why a.video-play-q-right:hover span ?
There's no link with video-play-q-right class. Try to replace it with a:hover .video-play-q-right
a.my-class:hover span means " a link (a element) with class my-class which contain a span ".
So it will target this:
<span>Some text</span>
But not this:
<span class="my-class">Some text</span>