How to put html input text into an image using CSS?
Tags: html,css,image
Problem :
I have an image like this:
How can I insert some input fields into the image?
It should be possible that the user click into the input fields (green boxes) of the image and enter some values?
Solution :
Create div
element with the dimensions of your image and set it's css position
to relative. Then set the image's position as absolute
and its coordinates 0,0. Then you can position all the checkboxes by absolute positioning as well.
By assuring that the wrapping div
has position: relative;
, you can position the checkboxes (and the image) from the border of the div
.
HTML
<div id="wrapper">
<img src="...">
<input type="checkbox" style="position: absolute; top: 20px; left: 100px;">
<input type="checkbox" style="position: absolute; top: 50px; left: 200px;">
</div>
CSS
div#wrapper {
position: relative;
width: 400px;
height: 200px;
}
img {
position: absolute;
top: 0;
left: 0;
}
CSS Howto..
I would wrap the input tag in a 'div' tag: HTML <div class="inputCont"> <input id="second" value="I am a bit messed up!" /> <i class="fa fa-calendar second"></i> </div> CSS .inputCont {...
Here just the CSSed div: http://jsfiddle.net/bmWGY/1/ You'll need much more if you want to do something with this div. ...
If you're using Bootstrap 3 this is how you do it, if you're using an older version refer to this Bootstrap 2.3.2 .wrapper { margin-top: 50px; } #theForm { background:...
Use :disabled selector. For example: input:disabled { color: #444; border: 1px solid #888; } See this Fiddle for a demo: http://jsfiddle.net/A9CN8/ All notable modern browser support :disabled, but for Internet...
I've used the technique you've described many times and always felt a little guilty. But I continually find that the easiest and most reliable way is to wrap my embeds...
was this what you were aiming for? http://jsfiddle.net/rKaPN/28/
With the markup you supplied, this is indeed possible with CSS alone: <a> <img src="http://placehold.it/100x100" /> <div> </div> </a> You can use the :hover pseudo selector to select the div...
You have put image path like: url("paper.gif") then put your image in same folder where your html file has. You have written correct way. Just set proper path. background-image: url("paper.gif");...
If you can consider using jQuery to wrap a div around the buttons, you can use this: jQuery wrap All $( ".q-button" ).wrapAll( "<div class='q-button-wrap' />"); Then you can apply...
Select boxes are not really styleable, so I wouldn't be surprised if this was impossible. Some limited styling options are available, but even they are unreliable. The only way to...
You have three ways to do it: 1- In the following snippet, I have used a css circle inside an image div on the first moon. 2- Alternatively, got the...
Got it! var divStyle = { position: "absolute", top: 0, right: 0, bottom: 0, left: 0, margin: 0, padding: 0 } ...
The images are not working because .slo and .eng have no height or content so they, and their background-images, do not appear. Give them both a height: .slo { background-repeat:no-repeat;...
Separate out the colours into different CSS classes like so: div.base-text { position: absolute; bottom: 9px; font-size: 10px; font-weight: bolder; text-align: center; width: 61px; text-transform: uppercase; } div.gold { color:...
Add a container div to hold the details, give it padding on the right hand side to top the test inside from crashing into the button and set it's position...
One way of doing it is by setting the display type of #cssmenu to inline-block and then wrap everything in a container with text-align: center. You also need to set...
'.dropdown-menu' catches the the bubble. There is no need to catch elements inside of the dropdown in this case. e.stopPropagation() prevents the event from bubbling up the DOM tree, preventing...
Hey now used to this stylesheet Give to your label Display inline-block; and give to width according to your layout Live demo ...
Is this the effect you want: http://jsfiddle.net/UmpdH/10/ [FINAL UPDATE] Basically, revise your html, use unordered list <ul> and wrap each anchor with <li>, float to left, and style the elements...
Your problem is just pure CSS, and because IE doesn't handle very well the "height: auto", you need to provide some specific value... So, here is your solution: .parent {...
HTML: <ul> <li class="products"> <a href="products.php">Products</a> <div id="nav-products" style='display:none'> <p>Search by part number or product name:</p> </div> </li> <li> <a href="about.php">About</a> </li> </ul> JS:...
Yes, the session would be a nice place to put it: You could create a file that is called to set the theme-session. Pass the chosen theme to that file...
Looks like you can't actually do this at the moment... however the CSS parser does support Infinity... Sounds like they're be pretty open to adding support for it if you...
You can do this using right floating on a series of child elements: span { float: right; } <div> <span>Text 1</span> <span>Text 2</span> <span>Text 3</span> <span>Text 4</span> <span>Text 5</span> </div>...
.test { cursor:url("http://www.javascriptkit.com/dhtmltutors/cursor-hand.gif"), auto; } http://jsfiddle.net/wNKcU/5/...
Since you ask for alternatives to jQuery solutions You could play a little with margins and box-shadow and keyframe animations. Something in this direction for the shape (depends on what...
You can't do it that way. CSS classes are hierarchical so: .button.details will only work for a structure like the following: <div class="button"> <div class="details"> </div> </div> It means for...
Use Float. It will help you to push content to extreme right. .top-contact-menu { background-color: #6aaf08; width: 100%; padding: 5px 0px; } .top-contact-menu h2 { color: #fff; font-size: 14px; display:...
From comment :- www.sportsdirect.com - I want to locate google app logo at startup (second popup) (Assuming you'r using JAVA) Actually this pop is inside an <iframe>, that's why you...
The right-floated div is doing just what it is told to in the original example: it is remaining at least 400px wide. If the viewport is reduced to less than...