I have a site and I want to use .less instead of .css but I have a problem with border radius, if I copy the same code into a css file work in .less doens.'t work, It doesn't take my radius and the div is rectangular. I have used a compiler and It gives me 0 error. I don't know if is a problem of compatibility. this is my code that doesn't work in less but in
css work:
.colLeft{
position:absolute;
top:0;
left:0;
background:#fff;
height:100%;
width:24%;
z-index:0;
}
.colCenter{
position:absolute;
top:0;
left:18%;
height: 100%;
width: 68%;
background: #ccc;
border-left: 1px solid #333;
border-radius: 50px 0px 0px 50px / 250px 0px 0px 250px;
z-index:100;
overflow:hidden;
-moz-box-shadow: 1px 1px 1px #000;
-webkit-box-shadow: 1px 1px 1px #000;
box-shadow: 1px 1px 1px #000;
}
.colRight{
position:absolute;
top:0;
left:81%;
background:#fff;
height:100%;
width:18%;
z-index:1000;
border-left: 1px solid #333;
border-radius: 50px 0px 0px 50px / 250px 0px 0px 250px;
}
Html:
<div class="colLeft" id="one">
</div>
<div class="colCenter" id="two">
<div class="content">
<div class="img_background">
<img src="img/sfondi/<?php echo (basename($_SERVER['HTTP_REFERER'],'.php')); ?>.jpg" alt="" class="old_img"/>
</div>
</div>
</div>
</div>
<div class="colRight" id="three">
index
NEXT
</div>
border-radius: 50px 0px 0px 50px / 250px 0px 0px 250px;
should be
border-radius: 50px 0px 0px ~"50px / 250px" 0px 0px 250px;
otherwise you get a division.
Less is in the process of introducing a policy of only doing division inside brackets so that valid css is unaltered, but this will be in a future release (e.g. maybe 1.4.0)
Related
I'm trying to create an overlay shadow over an image in CSS but I can't seem to get it right.
Here's the code that I have so far.
http://jsfiddle.net/Qf4Ka/1/
HTML
<section id="top-container" class="top-column" style="width:1050px; height:420px; ">
<div class="image" style="padding-top: 10px; float:left;"><img src="http://www.hdwallpapersinn.com/wp-content/uploads/2012/09/HD-Wallpaper-1920x1080.jpg" border="0"; width="263"; height="200" style="display: block; border-top: 1px solid #dddddd; border-bottom: 1px solid #dddddd; border-right: 1px solid #dddddd;">
<h4 style="font-size:30px; top: 90px; ">Nature</h4></div>
<div class="image" style="padding-top: 10px; float:left;"><img src="http://www.hdwallpapersart.com/wp-content/uploads/2013/04/tiger_wallpapers_hd_Bengal_Tiger_hd_wallpaper1.jpg" border="0"; width="262"; height="200" style="display: block; border-top: 1px solid #dddddd; border-bottom: 1px solid #dddddd; ">
<h4 style="font-size:30px; top: 90px; ">Bengal Tiger</h4></div>
</section>
CSS
.image {
position: relative;
}
h4 {
position: absolute;
width: 100%;
color: #fff;
float: left;
position: absolute;
font-size: 40px;
font-family: "Oswald";
text-align: center;
max-height:auto;
z-index:20;
text-shadow:1px 1px 2px #000;
-moz-text-shadow:1px 1px 2px #000;
-ms-text-shadow:1px 1px 2px #000;
-o-text-shadow:1px 1px 2px #000;
-webkit-text-shadow:1px 1px 2px #000;
}
I basically want it to look like the one in this website. I tried looking at some tutorials online but it screwed it up real bad so I removed it. I want it to look like the one in this website before and after I hover around the image. Thanks so much to anybody who can help me.
http://vr-zone.com/
Like this
demo
css
.image {
position: relative;
-webkit-box-shadow: inset 0 0 10px 10px #000;
-moz-box-shadow: inset 0 0 10px 10px #000;
box-shadow: inset 0 0 10px 10px #000;
}
OR REF LINK
Your text shadow effect actually seems to work fine, just a few syntactical errors within the html, and need to import the font. Also you don't need to vendor prefix the text-shadow rule.
Check this DEMO.
Edit: I agree with the comment above - Yes, if you are trying to give box-shadow to the image, then use box-shadow.
If I use bootstrap, it messes the alignment up on my page. Member names should be appeared right next to icon, but with Bootstrap, they overlap the icon.
How can I fix this?
Also, when the browser window is made smaller, the square line gets messed up too. I want the data to have a border when the window is small.
So I don't want it to look like this:
But rather, like this:
If possible I want to have these icon, and name in middle not on the top.
DEMO http://jsfiddle.net/sbq7X/
HTML
<div class="store_row">
<div class="store_left">
<div class="store_title">walmart</div>
<div class="store_location">Located in California</div>
</div>
<div class="store_right">
<div class="store_icon">
<img class="img-polaroid" src="http://www.miraiha.net/wpblog/wp-content/uploads/2010/10/designreviver-free-twitter-social-icon-300x266.jpg" />
</div>
<div class="introduction">
<div class="name1">John Tailor</div>
<div class="name2">Mike Smith</div>
<div class="name3">Jessica Swan</div>
</div>
</div>
</div>
<div class="store_row">
<div class="store_left">
<div class="store_title">walmart</div>
<div class="store_location"><span class='text-error'>Located in California</span></div>
</div>
<div class="store_right">
<div class="store_icon">
<img class="img-polaroid" src="http://media-cache-ec1.pinterest.com/avatars/walmarthub-1349815045_600.jpg" />
</div>
<div class="introduction">
<div class="name1">John Tailor</div>
<div class="name2">Mike Smith</div>
<div class="name3">Jessica Swan</div>
</div>
</div>
CSS
div.store_row{
min-width: 300px;
margin-bottom: 20px;
margin-left: 10px;
margin-right: 10px;
border:1px solid;
display:table;
}
div.store_left{
width: 300px;
display:inline-block;
vertical-align:top;
}
div.store_right{
width: 300px;
display:inline-block;
vertical-align:top;
background-color: #FFFFFF;
}
div.store_title{
background-color: #000000;
color: #FFFFFF;
height: 35px;
padding:5px;
}
div.store_location{
height: 35px;
border-right:1px solid;
background-color: #FFFFFF;
padding:5px;
}
div.store_icon{
width: 70px;
height: 70px;
display:inline-block;
}
div.store_icon img{
width:100%;
height:100%;
}
div.introduction{
display:inline-block;
vertical-align:top;
width:200px;
text-align: left;
}
.... and bootstrap
img-polaroid class has 4px padding and it causes the problem:
.img-polaroid {
padding: 4px;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
See the fiddle where it's removed.
EDIT: The alignment is working fine as well. You have static width for the all elements and they're too wide for fiddle. I've decreased their size so they are inline now.
I am having issues with rounding corners, they keep wanting to crop off on the left side by a few pixels. Below is the code I am using. I've tried increasing numbers and decreasing numbers; I've added a wrapper; I've tried all different solutions I can find for searching, but it still crops off. Can anyone give me a hand since I don't seem to be very handy? And apparently I can't post a picture of what it looks like either.
<style>
.image
{
width: 200px;
position:relative;
-webkit-border-radius: 14px;
-moz-border-radius: 14px;
-khtml-border-radius: 14px;
border-radius: 14px;
overflow: hidden;
}
#slideshow
{
margin:0 0 0 0;
position:relative;
width:200px;
height:133px;
padding: 10px;
overflow:hidden;
-webkit-border-radius: 14px;
-moz-border-radius: 14px;
-khtml-border-radius: 14px;
border-radius: 14px;
box-shadow: 0 0 20px rgba(0,0,0,0.3);
}
#slideshow > div
{
position:absolute;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script>
$(function() {
$("#slideshow > div:gt(0)").hide();
setInterval(function()
{
$('#slideshow > div:first')
.fadeOut(2000)
.next()
.fadeIn(2000)
.end()
.appendTo('#slideshow');
}, 3000);
});
</script>
<div id="slideshow">
<div class="image"><img alt="" class="icon-action" src="img url" width="200"/></div>
<div class="image"><img alt="" class="icon-action" src="img url" width="200"/></div>
<div class="image"><img alt="" class="icon-action" src="img url" width="200"/></div>
</div>
I had the very same problem when the border-radius spec came out. Turns out you have to add border-radius to the <img> tag. Then you can either keep or remove the <div>'s border-radius property.
Essentially you need to be dealing with nested rounded corners which are fairly helpfully generator with this useful tool.
http://joshnh.com/tools/get-your-nested-border-radii-right.html
I've been able to solve this issue using the following css. This has worked on my sites I hope it can help you out with your problem. Not sure if it's a argument you are missing or not.
.classname {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
background-color:#ededed;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#777777;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #ffffff;
}
You can try this:
div.circle
{
width: 10px;
height: 10px;
background: white;
border-radius: 28px;
-moz-border-radius: 64px;
-webkit-border-radius: 64px; padding:32px;
border: 2px black;
color:white;
text-align:center;
-webkit-box-shadow: 0 0 1px rgb(255,0,0);
-moz-box-shadow: 0 0 1px rgb(255,0,0); box-shadow: 0 0 1px rgb(255,0,0);
}
I am trying to create a simple image link button that when I move my mouse on it, it gets a bit larger.
I managed to do it with this simple code below but now I just want to move also the paragraph when the image is getting larger..
Any hints on how I can select and move the paragraph when I hover over the image?
<div id="rightImage">
<img src="images/image.jpg" alt="image" onmouseover="this.className='mouseOver'" onmouseout="this.className='mouseOut'" />
<p>paragraph</p>
</div>
#rightImage
{
width:275px;
height:275px;
float:left;
position:relative;
}
.mouseOver
{
width:300px;
height:300px;
top:-40px;
z-index:1;
position:absolute;
box-shadow:2px -2px 10px 3px #888, inset 2px -2px 10px 3px #888;
}
.mouseOut
{
width:275px;
height:275px;
float:left;
margin-right:52px;
box-shadow:2px -2px 10px 3px #888, inset 2px -2px 10px 3px #888;
}
This enlarges the image, increases the size of the shadow and keeps the <p> element visible.
(EDIT: I forgot to encode the angled braces around the p)
Perhaps it's what you need?
<!DOCTYPE html>
<html>
<head>
<script>
</script>
<style>
#rightImage
{
height:275px;
float:left;
position:relative;
box-shadow:2px -2px 10px 3px #888, inset 2px -2px 10px 3px #888;
}
#rightImage:hover img
{
height: 300px;
box-shadow:4px -4px 10px 3px #888, inset 4px -4px 10px 3px #888;
}
</style>
</head>
<body>
<div id="rightImage">
<img src="img/redBaron.jpg" alt="image"/>
<p>paragraph</p>
</div>
</body>
</html>
Remove position:absolute
.mouseOver
{
width:300px;
height:300px;
z-index:1;
box-shadow:2px -2px 10px 3px #888, inset 2px -2px 10px 3px #888;
}
Demo http://jsfiddle.net/aRv2M/2/
Try this. I hope it works for you.
<div id="rightImage">
<img src="images/image.jpg" alt="image" width="275px" height="275" />
<p>paragraph</p>
</div>
use this css
#rightImage{
width:275px;
height:275px;
float:left;
position:relative;}
#rightImage:hover{
width:300px;
height:300px;
top:-40px
z-index:1;
position:absolute;
box-shadow:2px -2px 10px 3px #888, inset 2px -2px 10px 3px #888;}
#rightImage:hover p {
position:relative;
margin-top:30px;}
I have the following css styles for an input tag...
<div class="container">
<input type="search" class="border" />
</div>
.container{
background: #000;
-webkit-border-radius: 25px 25px 25px 25px;
border: 3px solid #000;
}
.border{
background:none;
-webkit-border-radius: 25px 25px 25px 25px;
border: 3px solid #000;
}
When i set background: none, the border-radius did not work in chrome but works well in all other browsers including ie9. So why in chrome, border radius doesn't work when background:none ?
Example :
http://jsfiddle.net/TSKpN/5/
Using this code:
<style>
#some-id{
background:none;
border: 3px solid #000;
border-radius: 25px;
}
</style>
<body>
<input type="text" id="some-id">
</body>