I am not very good at CSS, the textbox has been aligned to right, I tried putting the search icon into the textbox, it just can't go in. Here are the code:
<style type="text/css">
#textbox-search{overflow:auto;}
#textbox-search input.searchkeyword {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border:1px solid #8e8e8e;
background-color:#f5f5f5;
height:16px;
padding:-4px;
padding-left:-48px;
color:#4a4a4a;
float:right;
}
#textbox-search input.button{
border:0;
padding:4px;
margint:0 0 0 600px;
width:24px;
height:24px;
background:transparent url('images/search.png') center center no-repeat;
float:right;
}
</style>
<form id="textbox-search">
<input type="submit" class="button" value="" />
<input type="text" class="searchkeyword" />
</form>
UPDATE :
You can simply achieve this using background property like this
input{
background: url("http://png.findicons.com/files/icons/1389/g5_system/32/toolbar_find.png") top right no-repeat;
height:30px;
padding-right:30px;
}
JS Fiddle Demo
You can change Height and padding value as per your image dimension.
you can easily do this
.searchkeyword {
width: 100%; /*textbox width*/
float: none;
background: url(your_image.png);
background-size: 20px 20px;/*background icon size*/
background-repeat: no-repeat;
background-position: 8px 10px; /*place where you wnat*/
display: block;
text-indent: 20px; /*help to indent your text on textfield*/
}
Related
I wanted to put an image inside a text input box and tried to position the image by nesting the image tag inside the input tag and using relative position for the input and absolute positioning for the image and setting the images 'right' and 'top' value to 0. I thought this would place the image on the right hand side of the text box. Instead it placed the image on the right hand side of the webpage. I'm unsure why this is, I found a solution by changing the 'top' and 'right' values to position it where I wanted but it just seemed like the first way should have worked, could anyone explain why it didn't?
This is the HTML for the text input and image.
<input = "text" id="searchbar">
<img src ="microphone.png" id="voicebutton"/>
</input>
This is the CSS I though would work.
#searchbar{
border: 0.6px solid #dbdbdb;
display:block;
margin-left:auto;
margin-right:auto;
width:600px;
height:37.5px;
position:relative;
}
#voicebutton{
width:16px;
height:23px;
position:absolute;
right:0;
top:0;
}
This is the CSS that worked.
#searchbar{
border: 0.6px solid #dbdbdb;
display:block;
margin-left:auto;
margin-right:auto;
width:600px;
height:37.5px;
position:relative;
}
#voicebutton{
width:16px;
height:23px;
position:absolute;
right:395;
top:207;
}
Three ways to do it:
1- Use the properties background-size and background-position to set your background-image inside the input-box. Example:
input[type=text] {
box-sizing: border-box;
padding-left: 10px;
font-size: 40px;
width:85%;
height:55px;
border: 2px solid black;
background-color: floralwhite;
background-image: url("https://cdn1.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/actions/emoticon.png");
background-size: 50px 50px;
background-repeat: no-repeat;
background-position: 99% 100%;
}
input[type=text]:focus {
background-color: pink;
outline: none;
}
<input type="text" placeholder="write here" id="searchbar">
2- Use a negative margin to place the image over it (you can set the image to be a link). Example:
input[type=text] {
box-sizing: border-box;
padding-left: 10px;
font-size: 40px;
width:85%;
height:55px;
border: 2px solid black;
background-color: honeydew;
vertical-align: top;
}
input[type=text]:focus {
background-color: skyblue;
outline: none;
}
img {
margin-top: 3px;
margin-left: -55px;
}
<input type="text" placeholder="write here" id="searchbar"><image src="https://cdn1.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/actions/emoticon.png" alt=img style="width:50px; height:50px;">
3- Let both inputbox and image inside a container; set the container position: relative and the image position: absolute (you can set the image to be a link). Example:
input[type=text] {
box-sizing: border-box;
padding-left: 10px;
font-size: 40px;
width:100%;
height:55px;
border: 2px solid black;
background-color: MintCream;
vertical-align: top;
}
input[type=text]:focus {
background-color: LightGreen;
outline: none;
}
img {
position: absolute;
top: 3px;
right: 5px;
}
#container {
position: relative;
width:85%;
}
<div id="container">
<input type="text" placeholder="write here" id="searchbar">
<image src="https://cdn1.iconfinder.com/data/icons/DarkGlass_Reworked/128x128/actions/emoticon.png" alt=img style="width:50px; height:50px;">
</div>
First of all, you can't have decimals in your pixels, like height: 37.5px;. This won't work. Also right: 395; does not work, because it doesn't specify what usage: pixels, ems, percentage? The input="text" is incorrect, it should be input type="text" as this can be e.g. email or radio.
That said, to achieve what you want, you can add a wrapper around your input field (like .box-wrapper) and give it a relative positioning with the same size as the input field. This will conclude to the example below.
.box-wrapper {
position: relative;
width: 600px;
height: 38px;
}
#searchbar{
border: 1px solid #dbdbdb;
display: block;
margin-left: auto;
margin-right: auto;
width: 600px;
height: 38px;
position: relative;
}
#voicebutton{
width: 16px;
height: 23px;
position: absolute;
top: 0;
right: 0;
}
<div class="box-wrapper">
<input type="text" id="searchbar">
<img src ="http://dummyimage.com/50x50/ffff00/fff" id="voicebutton"/>
</div>
The input tag has no closing tag in HTML, you should remove the closing tag from your HTML code, additionally you can position the element over the input box changing your CSS to something like this (your CSS was almost right, the problem is the HTML) :
#voicebutton{
width:16px;
height:23px;
position:absolute;
right:16px;
top:16px;
}
In HTML, the input tag has no end tag (as opposed to XHTML), so your a tag is outside of your input tag.
I am trying to get an image inside of the following search box:
<input class="search" type="text" name="q" id="q" size="70" maxlength="2048" style= "display:block; position:relative; left:35.5%; bottom:-3px; height:2em;">
</input>
When I try to direct the mic image to go inside of the search box, it ends up disappearing behind the box. Does anyone know how to place this image inside of the search box without it vanishing?
Here is the fiddle for it: https://jsfiddle.net/gLvzdj0n/3/
Check out this Jsfiddle link
HTML code:
<div class="wrap left rounded">
<input type="text" class="search left rounded" value="Search for dishes or restaurants" />
<button class="go left rounded"><span></span></button>
</div>
CSS code:
.left {
float:left;
}
.rounded {
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
}
.wrap {
position:relative;
padding:5px 6px 6px 7px; /* readjust in jsfiddle*/
background:#f0f0f0;
border:1px solid #ccc;
overflow:hidden;
}
.search {
width:360px;
position:relative; top:2px; /* readujst in jsfiddle */
padding:8px 5px 8px 30px;
border:1px solid #ccc;
background:white url(http://i.imgur.com/lFkqn.png) left center no-repeat;
}
.go {
position:relative; top:0;
padding:3px 5px 2px;
margin-left:8px;
border:none;
background: -webkit-gradient(linear, left top, left bottom, from(#d631a7), to(#8f1b64));
background: -moz-linear-gradient(top, #d631a7, #8f1b64);
}
.go span {
display:block;
width:64px; height:28px;
background:url(http://i.imgur.com/mxxzQ.png) 0 0 no-repeat;
}
You can solve this problem by css (position)
as the following:
<div id="MyDiv" style="position: absolute;">
<img src="img/clearSearchbutton.png" id="imgInInput" style="position: absolute;">
</div>
then give your div style like margin or padding to put your image inside input
Note if you need 'X' button just do this
<input class="search" type="search" name="q" id="q" size="70" maxlength="2048" style= "display:block; position:relative; left:35.5%; bottom:-3px; height:2em;">
</input>
you can remove #mic span and apply mic to input background.
see jsfiddle below
Demo Jsfiddle
change your css like below
.search {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACrElEQVR42u2Xz2sTQRSAX8VSb1K8iNqKooJH2Ux6Ksn+iPQqxZMIehJB0do/IMhmQWsvHr2KSEGk0tSLIoWIYNUKij20F2/N7iaUZnYT0kYzzhMKs0HDJiTdLcwHDwKZSd63781LBiQSSW9JZdkhzfKm1Rz9mjZp/W9YdEU3vXv4HsQZ40FtNG36q5rls//Ej4tmbSS2T15Mvp3ExOPmEMQNbBtMMEyoljcFcQN7PqyAlqNfIG7gYQ0tYNIaxA1MrJPY3wImbUqBKAXSFv0tBSIVMOkvKRDtGKWN/T6FdqRAxFNoWwpEPIXqUqBT6ALU/UVgu8GW4GD3f6f9TRDYNJTDrk7YbtiqUumHwIYoUJuHERDAS0r4CvgFECgbY+cFAR7KT+g1POmCKFDNw6WggHc3fBtVb4CAoyauBgXIG+g1Xh5mRAGah6cggBd11fK/h7lOprIs0H6uRl6KAo5O7kOv4QmPiwJ4Jqqv4FiwCtXjvD2+tRmfK6kZ/ygI2HritK0rDVGgrClJ6DWMwYC/AGuCBMYcIC2V0CzvjmbRz3j3xUjn6CfeYreUJ2wQkGD75INPX1mFfsEFrrcIYCvdhC4paWQakxajpJMr0C9YFg54i7AsClRmh9/xnr0NHcInzZStk2aLwAcGMAD9pPIazvFKVDD5rdnhJeHLX5RTyRPQHpz5o66emMc9wdlPtvA8wF7Aq2BUHh1525qEo5JtR1WeOXpickO9cJIpyuD6xJmhYiZ5ytWSl3mlnuOaf+2zDaLDXmJrSgZ/MYVEugo+gSh+FkSBa4yd5Ul87DZ5XpFl/AyIEjzYjkau8WqshU2cr13HPbgX4gJOD97n465GZlyVvC9mSKloKI2iTnbwNT+gBX54H+IaXAtxJzE3ycSAFqSAFJACUkAikXD+AHj5/wx2o5osAAAAAElFTkSuQmCC");
background-position: right center;
background-repeat: no-repeat;
background-size: 24px 24px;
}
Check this out.
I had edited your fiddle.
#mic {
background-position: -2.99999976158142px 0px;
color: rgb(17, 34, 204);
cursor: pointer;
display: block;
height: 22.9861125946045px;
vertical-align: middle;
white-space: nowrap;
width: 16.9965286254883px;
perspective-origin: 8.48958396911621px 11.4930562973022px;
transform-origin: 8.48958396911621px 11.4930562973022px;
background: rgba(0, 0, 0, 0) url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACrElEQVR42u2Xz2sTQRSAX8VSb1K8iNqKooJH2Ux6Ksn+iPQqxZMIehJB0do/IMhmQWsvHr2KSEGk0tSLIoWIYNUKij20F2/N7iaUZnYT0kYzzhMKs0HDJiTdLcwHDwKZSd63781LBiQSSW9JZdkhzfKm1Rz9mjZp/W9YdEU3vXv4HsQZ40FtNG36q5rls//Ej4tmbSS2T15Mvp3ExOPmEMQNbBtMMEyoljcFcQN7PqyAlqNfIG7gYQ0tYNIaxA1MrJPY3wImbUqBKAXSFv0tBSIVMOkvKRDtGKWN/T6FdqRAxFNoWwpEPIXqUqBT6ALU/UVgu8GW4GD3f6f9TRDYNJTDrk7YbtiqUumHwIYoUJuHERDAS0r4CvgFECgbY+cFAR7KT+g1POmCKFDNw6WggHc3fBtVb4CAoyauBgXIG+g1Xh5mRAGah6cggBd11fK/h7lOprIs0H6uRl6KAo5O7kOv4QmPiwJ4Jqqv4FiwCtXjvD2+tRmfK6kZ/ygI2HritK0rDVGgrClJ6DWMwYC/AGuCBMYcIC2V0CzvjmbRz3j3xUjn6CfeYreUJ2wQkGD75INPX1mFfsEFrrcIYCvdhC4paWQakxajpJMr0C9YFg54i7AsClRmh9/xnr0NHcInzZStk2aLwAcGMAD9pPIazvFKVDD5rdnhJeHLX5RTyRPQHpz5o66emMc9wdlPtvA8wF7Aq2BUHh1525qEo5JtR1WeOXpickO9cJIpyuD6xJmhYiZ5ytWSl3mlnuOaf+2zDaLDXmJrSgZ/MYVEugo+gSh+FkSBa4yd5Ul87DZ5XpFl/AyIEjzYjkau8WqshU2cr13HPbgX4gJOD97n465GZlyVvC9mSKloKI2iTnbwNT+gBX54H+IaXAtxJzE3ycSAFqSAFJACUkAikXD+AHj5/wx2o5osAAAAAElFTkSuQmCC) no-repeat scroll -2.99999976158142px 0px / 23.9999980926514px 23.9999980926514px padding-box border-box;
border: 0px none rgb(17, 34, 204);
font: normal normal normal normal 16px/38px arial, sans-serif;
outline: rgb(17, 34, 204) none 0px;
right: 10px;
top: 15px;
position: absolute;
}
/*#SPAN_1*/
<input class="search" type="text" name="q" id="q" size="70" maxlength="2048" style="display:block; position:relative; left:35.5%; bottom:-3px; height:2em;">
</input>
<span id="mic"></span>
Try this link and I think that is what you want
http://codepen.io/rafibomb/pen/rFgcI?editors=101
placing an image inside search box.
Keep it SIMPLE!
All you need to do is just put your stuff in a container div like this:
<div style="width:50px; height:20px; position:absolute;">
<input class="search" type="text" name="q" id="q" size="70" maxlength="2048" style= "display:block; position:relative; left:35.5%; bottom:-3px; height:2em; z-index:1;">
</input>
<span id="mic"></span>
</div>
Remove left and bottom (they are not much needed) from your input box and ADD position:absolute;.
This is the CSS for your <input>:
display: block;
height: 2em;
width: 100%;
position: absolute;
And now Remove margin-left:800px; and ADD position: absolute; , right: 0px; and margin-top: 4px;. Here is the CSS for your <span>
color: #12C;
cursor: pointer;
display: block;
vertical-align: middle;
white-space: nowrap;
width: 16.9965px;
border: 0px none #12C;
outline: 0px none #12C;
height: 22.9861px;
background: transparent url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACrElEQVR42u2Xz2sTQRSAX8VSb1K8iNqKooJH2Ux6Ksn+iPQqxZMIehJB0do/IMhmQWsvHr2KSEGk0tSLIoWIYNUKij20F2/N7iaUZnYT0kYzzhMKs0HDJiTdLcwHDwKZSd63781LBiQSSW9JZdkhzfKm1Rz9mjZp/W9YdEU3vXv4HsQZ40FtNG36q5rls//Ej4tmbSS2T15Mvp3ExOPmEMQNbBtMMEyoljcFcQN7PqyAlqNfIG7gYQ0tYNIaxA1MrJPY3wImbUqBKAXSFv0tBSIVMOkvKRDtGKWN/T6FdqRAxFNoWwpEPIXqUqBT6ALU/UVgu8GW4GD3f6f9TRDYNJTDrk7YbtiqUumHwIYoUJuHERDAS0r4CvgFECgbY+cFAR7KT+g1POmCKFDNw6WggHc3fBtVb4CAoyauBgXIG+g1Xh5mRAGah6cggBd11fK/h7lOprIs0H6uRl6KAo5O7kOv4QmPiwJ4Jqqv4FiwCtXjvD2+tRmfK6kZ/ygI2HritK0rDVGgrClJ6DWMwYC/AGuCBMYcIC2V0CzvjmbRz3j3xUjn6CfeYreUJ2wQkGD75INPX1mFfsEFrrcIYCvdhC4paWQakxajpJMr0C9YFg54i7AsClRmh9/xnr0NHcInzZStk2aLwAcGMAD9pPIazvFKVDD5rdnhJeHLX5RTyRPQHpz5o66emMc9wdlPtvA8wF7Aq2BUHh1525qEo5JtR1WeOXpickO9cJIpyuD6xJmhYiZ5ytWSl3mlnuOaf+2zDaLDXmJrSgZ/MYVEugo+gSh+FkSBa4yd5Ul87DZ5XpFl/AyIEjzYjkau8WqshU2cr13HPbgX4gJOD97n465GZlyVvC9mSKloKI2iTnbwNT+gBX54H+IaXAtxJzE3ycSAFqSAFJACUkAikXD+AHj5/wx2o5osAAAAAElFTkSuQmCC") no-repeat scroll -3px 0px / 24px 24px;
position: absolute;
right: 0px;
perspective-origin: 8.48958px 11.4931px;
transform-origin: 8.48958px 11.4931px 0px;
margin-top: 4px;
Hope this resolves your issue.
P.S.Whatever CSS i have mentioned in this is an update of your present link of JSFiddle.
I've settle up sizes, table-cell, and stuff, yet it is not working. I need to align the girl image on the bottom of the div, the text and button are fine.
Here is my code:
<style type='text/css'>
.wrapperbannerbanner{
overflow:hidden;
color:#FFFFFF;
font-family:Arial, Helvetica, sans-serif;
font-size:15px;
font-weight:bold;
position: relative;
float: left;
left: 0px;
width: 200px;
background-color:#FF9900;
}
.toppadding {
margin-top: 5px;
margin-left: 2px;
margin-right: 2px;
}
.left2222{
position: relative;
/* float: left; */
left: 12px;
text-align:left;
}
.generalbanner001 {
background-color: #FFFFFF;
margin-top: 0.5%;
/* margin-bottom: 8px; */
margin-left: auto;
margin-right: auto;
width: 80px;
height: 35px;
position: relative;
float:left;
-webkit-border-radius: 4px;
-khtml-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
text-shadow: none;
}
.generalbanner001:hover {
background: #0a0d0f;
text-decoration: none;
-webkit-border-radius: 4px;
-khtml-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
text-shadow: none;
}
.conferir001 {
padding:8px 0 0 10px;
}
.imageleft1222{
float: left;
left: 4px;
min-width: 90px;
height:120px;
display:table;
}
.imgalign {
width:90px;
height:95px;
vertical-align:bottom;
display:table-cell;
}
</style>
<div class="wrapperbannerbanner">
<div class="toppadding">
<div class="imageleft1222"><div class="imgalign" style="background:url(http://0-media-cdn.foolz.us/ffuuka/board/foolz/thumb/1390/58/13905801439073s.png) no-repeat;"></div></div>
<div class="left2222">
<span>Vai criar um site? Hospede com quem entende do assunto</span>
<div class="generalbanner001"><div class="conferir001" style="color:#FF9900;">Conferir</div></div>
</div>
</div>
</div>
The Fiddle:
http://jsfiddle.net/4SmV7/1/
The crux here is setting the background-position on .imgalign
Demo Fiddle
Change your CSS for .imgalign to:
.imgalign {
width:90px;
height:95px;
vertical-align:bottom;
display:table-cell;
background-image:url(http://0-media-cdn.foolz.us/ffuuka/board/foolz/thumb/1390/58/13905801439073s.png);
background-position:bottom;
background-repeat:no-repeat;
}
And take the inline styles out for .imgalign:
<div class="wrapperbannerbanner">
<div class="toppadding">
<div class="imageleft1222">
<div class="imgalign"></div>
</div>
<div class="left2222"> <span>Vai criar um site? Hospede com quem entende do assunto</span>
<div class="generalbanner001">
<div class="conferir001" style="color:#FF9900;">Conferir</div>
</div>
</div>
</div>
</div>
More on background-position from MDN
The background-position CSS property sets the initial position,
relative to the background position layer defined by background-origin
for each defined background image.
You try to align bottom a div with a background-image. You need to set the height of this div equal to his parent height, and set the background-image alignment to bottom center
So you're using a background image that you need to align to the bottom, correct?
In that case, I would get rid of the class "imgalign" altogether, and have the below CSS on its container:
.imageleft1222{
float: left;
left: 4px;
min-width: 90px;
height:120px;
display:table;
background-image:url(http://0-media-cdn.foolz.us/ffuuka/board/foolz/thumb/1390/58/13905801439073s.png);
background-repeat: no-repeat;
background-position: bottom;
}
It's better to list the background properties separately because the Firefox browser doesn't always display it properly if you group them all into 'background'.
In a big div I have search box which basically is a div having text box glass image and button. Requirement is to positioned this search wizard vertically in middle and on right side in div. This box is coming on top left inside div. I have tried different things but not getting how to set it. Please guide me.
Thanks
<div class="Right">
<div class="header-search" style="position: relative; top: auto; bottom: auto; right: 0 left:100%;
margin: auto 0 auto auto;">
<input type="text" class="searchbox" />
<input type="button" class="searchbutton" value="›" />
</div>
</div>
div.Container div.Right
{
width:50%;
float:right ;
border: 01px dashed green;
height:95px !important;
padding:auto 0 auto 200px;
}
div.header-search
{
overflow:auto;
display:inline;
text-align:right !important;
border:3px dashed blue;
padding:20px 0 auto 50px;
}
div.header-search input.searchbox
{
border-bottom-left-radius:5px;
-webkit-border-bottom-left-radius:5px;
-moz-border-bottom-left-radius:5px;
border-top-left-radius:5px;
-webkit-top-left-radius:5px;
-moz-left-radius:5px;
border:2px solid #316200;
background-color:white;
height:16px;
padding:4px;
padding-left:28px;
padding-right:10px;
color:#4a4a4a;
float:left;
background:white url(../images/SearchImage.png) 0 50% no-repeat;
}
div.header-search input.searchbutton
{
border-bottom-right-radius:5px;
-webkit-border-bottom-right-radius:5px;
-moz-border-bottom-right-radius:5px;
border-top-right-radius:5px;
-webkit-top-right-radius:5px;
-moz-right-radius:5px;
background:#458A00;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#A5D376', endColorstr='#326400'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#A5D376), to(#326400)); /* for webkit browsers */
background: -moz-linear-gradient(top, #A5D376, #326400); /* for firefox 3.6+ */
width:50px;
height:28px;
color:White;
font-size:16px;
font-weight:bold ;
border:2px solid #316200;
border-left:none;
}
The first step in understanding how positioned elements is reading an article like this one:
CSS-Tricks.com - absolute positioning inside relative positioning
you are using position: relative on the wrong div as it should be assigned to .Right- while header-search should have instead 'position: absolute;' and values for left/right and top/bottom
the article above explains it much better than I could ever do!
Perhaps this would be a good starting point:
<div class="Right">
<div class="header-search">
<input type="text" class="searchbox" />
<input type="button" class="searchbutton" value="›" />
</div>
</div>
div.Container div.Right {
position: relative;
width: 50%;
float: right;
border: 1px dashed green;
height: 95px !important;
padding: auto 0 auto 200px;
}
div.header-search {
position: absolute;
right: 0;
top: 0;
overflow: auto;
display: inline;
text-align: right !important;
border: 3px dashed blue;
padding: 20px 0 auto 50px;
}
remove all styling from your div's as this is bad practice. Next, convert your two styles for .Right and .header-search like this:
div.Right {
border: 1px dashed green;
height:95px;
position: relative;
}
div.header-search {
border:1px dashed blue;
position: absolute;
top: 30px;
right: 0;
}
This should accomplish what you are attempting. There isn't a clean, easy way to center vertically, but since you have a fixed height on the outter .Right div and a fixed height on the search elements, it's best just to use a fixed top position on the inner .header-search.
You can see it in action on this jsfiddle:
http://jsfiddle.net/L4sgc/
Please take a look at my fiddle:
http://jsfiddle.net/gX5r9/
I want the div to be of width 100% in the event the browser is resized however I want the icon image to be to the right of it.
<div class="theDiv">
<input type="text" /><img src="http://images.ilias.ca/Firefox-32x32.png" />
</div>
.theDiv input {
width:100%;
height 32px;
border= 1 px solid;
border-radius: 6px;
}
.theDiv img{
display: inline;
}
Here's one way to do this using background images: jsFiddle example
HTML
<div class="theDiv">
<input type="text" />
</div>
CSS
.theDiv input {
height:32px;
border: 1px solid #999;
border-radius: 6px;
width:100%;
vertical-align:bottom;
}
.theDiv {
background:url(http://images.ilias.ca/Firefox-32x32.png) 100% 0% no-repeat;
padding-right:38px;
height:40px;
}
.theDiv input {
width:100%;
height 80px;
border= 1 px solid;
border-radius: 6px;
padding-top:10px;
padding-bottom:10px;
display:block;
background-image:url(http://images.ilias.ca/Firefox-32x32.png);
background-repeat:no-repeat;
background-position:right center;
}
About the checking if the window is resized. See this resource #media
Solution 2
.theDiv {
height:32px;
position:relative;
}
.theDiv input {
width:100%;
height 32px;
border= 1 px solid;
border-radius: 6px;
}
.theDiv img{
position:absolute;
z-index:666;
right:10px;
}