Well I want to place a caption on the border of my images for a image gallery I am developing.
Basically my images use borders and margins to create a effect around them to make them look like Polaroid photos. I would like to place a caption on top of the border. here is my css.
.column img {
position:relative;
display:inline-block;
width:130px;
height:100px;
margin: auto;
padding:10px;
background:#fff;
box-shadow:0 0 5px rgba(0,0,0,.35);
-webkit-box-shadow: 1px 3px 3px rgba(0,0,0,.8);
-moz-box-shadow: 1px 3px 3px rgba(0,0,0,.8);
box-shadow: 1px 3px 3px rgba(0,0,0,.8);
border: 1px solid #fff;
padding: 5px 5px 35px 5px;
}
.column div {
max-width: 100%;
max-height: 100%;
float: left;
margin: 0 15px 5px 0;
margin-left: 5px;
border-radius: 2px;
overflow:hidden;
}
The border works fine and looks fine but the caption does not display on top of the border any help would greatly be appreciated.
Try using the <fieldset> and <legend> tags to draw a captioned box around the images.
<fieldset>
<legend>Caption Here</legend>
<!-- Image here -->
</fieldset>
Related
I have the following code in my CSS and HTML files:
.test {
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: inset 60px 0px white, inset 200px 0px blue;
}
<div class="test"></div>
The shape this code produces is exactly what I want; however, I do not want the blue outline around the white part - is there anyway I can remove that?
To further clarify: here is what the shape currently looks like on a white background, and here is how I would like it to look like.
All help is greatly appreciated!
Perhaps a trick, to overlay a 2px white border over it is acceptable.
.test {
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: inset 60px 0px 0px 0 white, inset 200px 0px 5px blue;
position:relative;
}
.test:before{
content:'';
position:absolute;
border-radius:50%;
border:2px solid white;
z-index:1;
top:-1px;
right:-1px;
bottom:-1px;
left:-1px;
pointer-events:none;
}
<div class="test"></div>
Tell us what you want to achieve so we can know how to help you achieve it.
This little change made the blue outline go away and left you circle looking like eclipse
.test {
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: inset 60px 0px white, inset 10px 0px blue;
}
im trying to add a image that acts as a button and the image is a rounded square where the 4 corners are transparent. I add it to my webpage like this :
<input type="image"id = "LeftButton" src="graphics/leftarrow.png" >
and style it like this:
#LeftButton{
background-color: Transparent;
position:relative;
left:0px;
top:32.5px;
width: 45px;
box-shadow: 10px -10px 5px rgba(0,0,0,0.6);
height: 45px;
}
I have coloured the background of the div its in red so you can see better in the image
thanks
the box shadow uses information from the box shape to generate the shadow in order to display as intended you will need to add a border-radius to your input
#LeftButton{
background-color: Transparent;
position:relative;
left:0px;
top:32.5px;
width: 45px;
box-shadow: 10px -10px 5px rgba(0,0,0,0.6);
border-radius: 4px 4px 4px 4px;
-moz-border-radius: 4px 4px 4px 4px;
-webkit-border-radius: 4px 4px 4px 4px;
border: 0px solid #000000;
height: 45px;
}
<input type="image"id = "LeftButton" src="graphics/leftarrow.png" >
and style it like this:
I have 2 div columns set to val%, within those columns I then have some smaller static width / height boxes ..
.. and on the other side a variable width / height column.
However as I vary the width of the browser window, these divs overlap.
I have tried various combinations of overflow / float / min and maximum heights etc but I am not getting anywhere.
Can someone point out what I'm missing?
Rough jsfiddle:
http://jsfiddle.net/2xdcases/
Actual Page:
https://www.ablueman.co.uk/testbench/newindex/
.content {
margin: 2px 0px 2px 0px;
border-bottom: 1px solid #BABABA;
padding: 10px 10px 10px 10px;
background-color: #b0c4de;
}
.cont {
float:left;
width:48%;
margin: 1px 0px 1px 0px;
border-bottom: 1px solid #BABABA;
padding: 5px 5px 5px 5px;
/*background-color: #b0c4de;*/
/* min-height: 600px; */
}
.co {
float:left;
width: 200px;
Height: 300px;
margin: 1px 0px 1px 0px;
border: 1px solid #BABABA;
padding: 2px 2px 2px 2px;
overflow:auto;
}
Give #contentWrapper overflow: hidden;
Because the elements on the left are floated, the parent element will not change its size accordingly
For more information read this: http://css-tricks.com/all-about-floats/ (especially under the heading 'The great collapse')
I'm trying to display an inset shadow on two elements and overlay them so they look like well with tab. Everything looks great except for one corner where I cannot figure out how to make it look smooth. (highlighted with yellow).
JsFiddle for test
this is my html:
<div class="container">
<div class="outerWell">
<div class="well" style="padding-top:15px">
text
</div>
</div>
<div class="well" style="margin-top:40px">
test
</div>
</div>
and then I have css that creates shadow and hides one side of shadow with overflow:hidden
(.well class is taken from bootstrap)
.well {
min-height: 20px;
padding: 19px;
margin-bottom: 20px;
background-color: #f5f5f5;
border: 1px solid #e3e3e3;
overflow:hidden;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-moz-box-shadow: inset 0 0 5px 1px #888;
-webkit-box-shadow: inset 0 0 5px 1px #888;
box-shadow: inset 0 0 5px 1px #888;
}
.outerWell {
width: 200px;
overflow: hidden;
padding-bottom: 10px;
height: 35px;
margin-top: -40px;
position:absolute;
}
Is there an easy way to fix my issue, or maybe a better way to do what I'm trying to achieve?
You could probably pull this off with some creative use of pseudo elements. Have a look at this post on CSS-Tricks.
I have some HTML retrieved from a database so I have no control over it and it looks different than if I just put it inside a div :
And here is my CSS:
#cvDiv {
position:absolute;
top:40px;
left: 300px;
border: none;
width: 720px;
display:inline;
background-color:White;
text-align:justify;
padding:15px;
box-shadow: 10px 10px 5px #888;
-moz-box-shadow: 0px 0px 5px 5px #888;
-webkit-box-shadow: 0px 0px 5px 5px #888;
z-index:auto;
}
and here is the HTML:
http://jsfiddle.net/ug96v/
What am I doing wrong?
And what I want to do is a make the the top picture look like the bottom one.
EDIT
This ended up being a DOCTYPE problem.
Don't use position:absolute;, it forces the div to position itself relative to the the first parent container that has position:relative;. It may be causing part of the problem.