This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Give a CSS styled div a “border-left-image”
Im trying to put a border on a div, to the left and to the right of the div.
HTML:
<div id="containerscontainer"><div>
CSS:
#containerscontainer {
width: 970px;
margin: 0 auto;
padding: 0px 0px 0px 0px;
background-color:#000;
border-left-image:url('/gfx/bkshadleft.png');
border-right-image:url('/gfx/bkshadright.png');
}
but for some reason in chrome i can see im getting error unknown property name? why is this? am i not doing it right?
Fiddle example: http://jsfiddle.net/uzi002/8dX7R/3/
To work in Chrome, you need to name the style:
-webkit-border-left-image
See this post: Give a CSS styled div a "border-left-image"
From experience, I feel like the syntax might be off, or the images aren't the right dimensions and the borders are off. I'd recommend using a website like this to generate the images:
http://border-image.com/
And also, I see no border images in your Fiddle.
Related
This question already has answers here:
CSS Image size, how to fill, but not stretch?
(18 answers)
Closed 4 years ago.
really basic question, but I do marketing for a client so don't know too much besides basics HTML, CSS.
I've got an image slider in the URL below, what should I do so the image occupies the full space of the container (as there are bars on either side of the image). Do I just remove the padding or is there something more efficient to put in the stylesheet. Thanks heaps for your help
https://www.vibrantrealestate.com.au/property/outstanding-warehouse-space-style-on-the-citys-edge/
Try to add this rule in your CSS file :
.inspiry_property_portrait_slider .flex-viewport ul li a img{
width: 100% !important;
}
Here is the result :
Use the following css
div
{
background-image:url(http://placekitten.com/200/300);
width:300px;
height:100px;
background-repeat:no-repeat;
background-size: cover;
}
<div>a</div>
This question already has answers here:
Removing body margin in CSS
(10 answers)
Closed 4 years ago.
Please see image for problems with CSS. I want the blue corners to fill the corners but there seems to always be a gap. I appreciate this may be a simple question but would be grateful for help.
photo of webpage and problem
Remove padding and margin on the body
html, body {
padding:0px;
margin: 0px;
}
This question already has answers here:
How to Create Grid/Tile View? [duplicate]
(8 answers)
Closed 6 years ago.
I'm writing a a layout in CSS and HTML where I want the expected layout to be rendered out from left to right, top to bottom like this:
Each box has different height but the same width. I don't know how many boxes there are, it can vary from 2 to 20. I've tried float: left, but then you will get empty space depending on the size of the boxes. I've also tried column in CSS3, but It behaves very randomly, both on browser type, number of boxes and the size of the boxes. Does anyone know a smart trick to make it look like this, and preferably without the use of Javascript.
Masonry does this: http://masonry.desandro.com/ - That's with JS though
You could achieve this with pure CSS. Use the column-width property and for the spacing a combination of column-gap and padding
HTML
<section>
<img src="path" />
<img src="path" />
<img src="path" />
</section>
CSS
section{
column-width: 300px;
column-gap: 5px;
padding: 5px;
}
section img{
width: 100%;
}
Demo
Pen
This question already has answers here:
How can I horizontally center an element?
(133 answers)
Closed 8 years ago.
How do you center a div or anything else horizontally, so that on both sides the empty spaces are equal? And the div is exactly in the middle? No matter the size of the objects.
Take for example: the Stackoverflow site itself.
Except for the black header on the top of this site, everything is in the middle and the empty spaces on both sides are equal to each other.
I've searched for a long time, but I only encountered the wrong answers or vague answers.
Please help and thank you!
In css, you can use margin: auto;
A common pattern is to wrap your content in a container with a fixed width and add margin: auto; to it.
try this. here is why
margin: 0 auto;
The common way is using margin:0px auto. Look at the following example.
HTML
<div id="wrapper">
<div class="test">
This is my content Div.
</div>
</div>
CSS
.test
{
width:60%;
border:1px solid #ccc;
margin:0px auto;
}
DEMO
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Space at the bottom and right side of my page
First off, I am sorry for posting this twice, my previous question earlier got good replies but they did not fix my problem.. so I am posting it again to hopefully get some more answers (I really need to fix this issue!)
Link for the actual page
Basically, at the bottom of my page between the offers/properties div and the footer there is a big space. I know why this is; I have used relative positioning and used top: -256px; to position the boxes where they are.
I have tried:
Aligning the 2 divs with absolute positioning - that does the trick of getting rid of the space at the bottom and I can get the boxes where I want them however if I was to scale down the browser, the boxes go out of position..(is there a way to get around that?)
Removing all positioning and floating them to the left/right - removes the space at the bottom/right but doesn't go into the position I would like them to
Sam on my previous question did this, it sorts of my problem just I can get them into position!
Adding overflow: hidden; to the container div.
I just don't know what to do so any help is really appreciated!
Thanks in advance!
EDIT:
Just saw that you got that answer already.. The next step is to put those boxes in a container.
<div id="offer_box_wrap"></div>
style
#offer_box_wrap {
width: 650px;
float: left;
margin-left: 5px;
}
you'll have to tweak it but it should work
end EDIT
You are relatively positioning your left boxes so...
i would suggest this
do not use <li> for boxes
use a div with a class that aligns them as you want.
<div class="offer_box"></div>
style it
.offer_box {
width: 208px;
height: 170px;
background: url(http://www.propertytest.uphero.com/images/offers_box.png) no-repeat;
float:left;
margin: (figure out the spacing you need for 3 per row)
}
put a clear div underneath the last one
<div style="clear: both"></div>
see it here http://jsfiddle.net/atTGa/2/