- This topic is empty.
-
AuthorPosts
-
May 7, 2012 at 4:12 pm #37971
RobM_01
MemberHi,
I’m very new to CSS and just wanted see if someone could help me with a final problem I have please with the jCarousel that I have managed to get almost working on my test site.
If you follow the link you will see the slideshow working, the problem I have is the image is vertically aligned to the top and I need it to be the middle.
I think i’ve tried everything but cannot get it to move to the centre at all. I just wondered if you have any ideas what it could be that’s preventing it.
I have tried the vertical-align: middle; but it does not work
Many thanks in advance
Cheers Rob.
/*
jCarousel
*/
#wrap
{
color: #2A3D4E;
}
.jcarousel-skin-tango .jcarousel-container
{
background: #2A3D4E;
}
.jcarousel-skin-tango .jcarousel-direction-rtl
{
direction: rtl;
}
.jcarousel-skin-tango .jcarousel-container-horizontal
{
padding: 10px 30px 10px 30px;
width: 610px;
}
.jcarousel-skin-tango .jcarousel-clip
{
overflow: hidden;
}
.jcarousel-skin-tango .jcarousel-clip-horizontal
{
width: 610px;
height: 610px;
}
.jcarousel-skin-tango .jcarousel-item
{
width: 610px;
height: 610px;
}
.jcarousel-skin-tango .jcarousel-item-horizontal
{
margin-right: 60px;
margin-left: 0px;
}
.jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-item-horizontal
{
margin-right: 0px;
margin-left: 60px;
}
/*
jCarousel Next Button
*/
.jcarousel-skin-tango .jcarousel-next-horizontal
{
background: url("../SiteImages/Next-Up.png") no-repeat 0px 0px;
top: 265px;
width: 32px;
height: 32px;
right: -20px;
position: absolute;
cursor: pointer;
}
.jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-next-horizontal
{
background-image: url("../SiteImages/Next-Up.png");
}
.jcarousel-skin-tango .jcarousel-next-horizontal:hover
{
background: url("../SiteImages/Next-Down.png");
}
.jcarousel-skin-tango .jcarousel-next-horizontal:focus
{
background: url("../SiteImages/Next-Up.png");
}
.jcarousel-skin-tango .jcarousel-next-horizontal:active
{
background: url("../SiteImages/Next-Down.png");
}
/*
jCarousel Prev Button
*/
.jcarousel-skin-tango .jcarousel-prev-horizontal
{
background: url("../SiteImages/Prev-Up.png") no-repeat 0px 0px;
top: 265px;
width: 32px;
height: 32px;
left: -20px;
position: absolute;
cursor: pointer;
}
.jcarousel-skin-tango .jcarousel-direction-rtl .jcarousel-prev-horizontal
{
background-image: url("../SiteImages/Prev-Up.png");
}
.jcarousel-skin-tango .jcarousel-prev-horizontal:hover
{
background: url("../SiteImages/Prev-Down.png");
}
.jcarousel-skin-tango .jcarousel-prev-horizontal:focus
{
background: url("../SiteImages/Prev-Up.png");
}
.jcarousel-skin-tango .jcarousel-prev-horizontal:active
{
background: url("../SiteImages/Prev-Down.png");
}
May 8, 2012 at 6:25 am #102489RobM_01
MemberAny ideas please?
May 8, 2012 at 6:38 am #102490Anonymous
InactiveIf your landscape and portrait images are always the same height, then padding the landscape ones will give you the effect you need. Otherwise, you will need to use some javascript to calculate based on maximum height what the padding on each image needs to be.
May 8, 2012 at 10:42 am #102506RobM_01
MemberSo you’re saying it can’t be done with CSS?
May 8, 2012 at 10:45 am #102507RobM_01
Memberthe images will always be 600px on the longest side.
May 8, 2012 at 10:55 am #102509Anonymous
InactiveYou can do it with CSS if the height will be constant for the portrait *and* landscape images. For example, if portrait images are always 600px tall, and landscape 450px, then the difference in height is 150px and applying a padding-top of 75px to the landscape images will center them.
May 8, 2012 at 11:40 am #102517RobM_01
Memberok i think i get the idea, i could have a different class for landscape images maybe.
May 8, 2012 at 11:56 am #102519RobM_01
Memberit sort of works :) but the border stays at the top… the 150px gap then the image. So in other words the top edge of the image has no border.
but it does move the image down fine.
May 8, 2012 at 12:08 pm #102520RobM_01
MemberMay 8, 2012 at 1:39 pm #102500RobM_01
MemberThanks for all your help Ben. Nice one.
I used “margin-top: 100px;” in my CSS file and now it works fine.
Cheers Rob.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.