i'm developing this website : www.sfitnesscenter.com
i'm trying to make the 4 boxes below the slider to be horizontally aligned 2 by 2 to the center. i've tried using margin:auto, but nothing changed.
here's the html
<section id="wrapsecond">
<div class="container">
<div class="services-wrap">
<?php if( get_theme_mod('shortinfo_sb') ) { ?>
<?php echo get_theme_mod('shortinfo_sb'); ?>
<?php } else { ?>
<?php echo '<h2>What We Do</h2>
<p>We are passionate about our clients results.</p>'; } ?>
<div class="space50"></div>
<!-- Home Boxes Section -->
<div class="home_boxes">
<?php
for($bx=1; $bx<5; $bx++) {
if( get_theme_mod('page-setting'.$bx)) {
$bxquery = new WP_query('page_id='.get_theme_mod('page-setting'.$bx,true));
while( $bxquery->have_posts() ) : $bxquery->the_post();
?>
<div class="one_third <?php if($bx%4==0){ ?>last_column<?php } ?>">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?>
<h4><?php the_title(); ?></h4><?php echo fitnesslite_content(22); ?>
<span class="ReadMore"><?php _e('Read More','fitness-lite');?> </span>
</a>
</div>
<?php endwhile; }else{?>
<div class="one_third <?php if($bx%4==0){ ?>last_column<?php } ?>">
<a href="#"><img src="<?php echo get_template_directory_uri(); ?>/images/thumb_0<?php echo $bx; ?>.jpg"><h4><?php _e('Page Title','fitness-lite'); ?><?php echo $bx; ?></h4><p><?php _e('Phasellus viverra aliquet magna quis interduming. Sed quis fringilla massa. In ut porttitor felis necing iaculis mi. Proin tempo...','fitness-lite');?></p><span class="ReadMore"><?php _e('Read More','fitness-lite');?></span>
</a></div>
<?php }}?>
</div>
<!-- Home Boxes Section -->
</div><!-- services-wrap-->
<div class="clear"></div>
</div><!-- container -->
</section><div class="clear"></div>
and here's the css
/* = Services section css
-------------------------------------------------------------- */
#wrapsecond{ background-color:#272727; color:#fff; padding-bottom:100px; }
.services-wrap, #FrontBlogPost .BlogPosts{ visibility:hidden;}
.one_third{ margin:0 5% 3.5% 0; float:left; padding:25px; border:2px solid #fff;}
.one_third:hover{ border-color:#ff4e1c;}
.one_third:hover .ReadMore{ background-color:#ff4e1c;}
.one_third img{ width:100%;}
.one_third h4{font:600 18px/22px 'Roboto',sans-serif; padding:20px 0; margin:0; text-transform:uppercase; color:#fff;}
.one_third h4 span{ color:#ff4e1c; font-weight:300;}
.one_third h4 span::after{content:" ________"; display:inline-block;}
.one_third p{ margin-bottom:20px; color:#fff;}
.last_column{clear:right; margin-right:0 !important; }
#media (max-width: 992px) {
.one_third { min-width: 45% }
}
#media (min-width: 992px) {
.one_third { max-width: 40% }
}
#wrapsecond h2{ font-size:40px; color:#fff; font-weight:600; margin-bottom:0; text-transform:uppercase; }
#wrapsecond h2 span{ color:#ff4e1c; font-weight:300; }
NB :
actually, the layout should be like this
top left : aerobic class,
top right : bellydance class,
bottom left : yoga class,
bottom right : zumba class
it was horizontally and vertically paralled, until my client put the contents the other day. nothing's change even after the photos was removed. so, i don't think it was caused by the dimension of those photos
Change the display of the boxes to inline-block and reduce the margin a bit. And remove the float .
Change the .one_third class to the following
.one_third {
margin: 0 3% 3.5% 0;
padding: 25px;
display: inline-block;
border: 2px solid #fff;
}
Avoid using floats . its a messy thing to deal with.
Related
Earlier I asked question about my profile design, I am said I was not gone use the same design on mobile phone but I've changed my mind, howere i use height:10%; on the banner in the main style but when using #media all and (max-width:1024;){} and having same class but with height:30%; it wont change. I have a different css where I do the same thing but there it works (most of the times).
html:
<?php if($user_visible == 'a'){ ?>
<!--Profile picture, banner, and main information-->
<div class="profile-wrapper">
<?php if(isset($user_avatar)){ echo'<img class="banner" src="/assets/images/banner/'.$user_banner.'" />'; }else{ echo'<img class="banner" src="/assets/images/banner/default.png" />'; }?>
<!--profile picture-->
<?php if(isset($user_avatar)){ echo'<img class="avatar" src="/assets/images/users/'.$user_avatar.'" />'; }else{ echo'<img class="avatar" src="/assets/images/users/default.png" />'; }?>
<!--user information-->
<div class="user-information">
<p><?php echo $user_name; ?><br />
<?php echo $user_firstname; ?> <?php echo $user_lastname; ?></p>
</div>
</div>
css:
/* **************************************************************************************
///////////////////////Main Style////////////////////////////////////////////////////////
************************************************************************************** */
#media all and (min-width:1024px;) {
.avatar {
border: 2px solid #fff;
border-radius:5px;
margin-top:-10%;
margin-left: 5%;
width:15%;
height:auto;
}
.banner {
border: 2px solid #fff;
border-radius:5px;
margin-top: 20px;
height:10%;
width:100%;
}
.profile-wrapper {
margin:0 auto;
width:90%;
}
}
/* **************************************************************************************
///////////////////////Tablet////////////////////////////////////////////////////////////
************************************************************************************** */
#media all and (max-width: 1024px) {
.banner { height:30%; }
}
/* **************************************************************************************
///////////////////////Phone/////////////////////////////////////////////////////////////
************************************************************************************** */
#media all and (max-width: 768px) {
.banner { height:30%; }
}
These are the most universal media queries out there as they will help you to cover most of the different screen sizes decently:
#media(max-width:767px){}
#media(min-width:768px){}
#media(min-width:992px){}
#media(min-width:1200px){}
So try these media queries for your banner:
#media(min-width:992px){
.banner {
height: 30%;
}
}
#media(min-width:1200px){
.banner {
height: 10%;
}
}
Dear Stackoverflow community,
I just can't figure out how to center the footer links on my magento website. The footer links are within a div and the correspondig CSS is, as I believe, as follows:
I have tried everything, from margin:auto to margin-right and margin-left auto.
Then I thought, maybe the right footer, there used to be a newsletter box there, is forcing to take up space, so I slashed it out, but still no effect. Anyone any idea what could be the solution? Thank you so much!
.footer-container { width:100%; text-align: left;}
.footer { margin: 0 auto 0;width: 940px; padding: 0 20px 30px; background: #fff; }
.aditional-footer { margin:0 auto 0; padding: 30px 20px 35px; width: 940px; background: #FFF;}
.footer .links li { text-transform: none;}
.footer-container a { color:#666669; font-size: 9px; }
/*.footer-container .footer-right { width: 250px; }*/
.footer .f-left { width:520px; text-align: left; margin: 0 auto;}
/*.footer .f-right { width:420px; text-align: right; }*/
This is the HTML
<html>
<div class="footer-container">
<div class="aditional-footer">
<?php echo $this->getChildHtml('bottomContainer') ?>
<div class="f-right">
<div class="footer-right">
<div class="right-conteiner">
<?php echo $this->getChildHtml('newsletter') ?>
<div class="clear"></div>
</div>
<div class="right-conteiner">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_time')->toHtml(); ?>
<?php if(themeOptions('topbtn')): ?>
<div id="back-to-top"><?php echo $this->__('Back to top') ?></div>
<?php endif; ?>
<div style="clear: both;"></div>
</div>
</div>
</div>
<div class="f-left footer-left">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('footer_shipping')->toHtml(); ?>
</div>
<div style="clear: both;"></div>
</div>
</div>
<div class="footer">
<?php echo $this->getChildHtml('bottomContainer') ?>
<div class="f-left">
<?php echo $this->getChildHtml('footer_links') ?><br />
<?php echo $this->getCopyright() ?>
<?php echo $this->getChildHtml('cms_footer_links') ?>
</div>
<div class="f-right">
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('verify')->toHtml(); ?>
</div>
</div>
</html>
Change the following code
.footer-container { width:100%; text-align: left;}
to
.footer-container { width:100%; text-align: center;}
Let me know if you have any query
I am trying to make some divs responsive.It's a joomla module actually. But it isn't responsive. My template is responsive. I put that module in a position but if resize the screen it gets bigger and it goes outside that position.
I started with the first div (YJYC container) and I set the width to 100%. This is a good start, becouse I noticed that if I resize the screen, the result is "good". But I have to do this at the other divs, right?.
How should I continue?
Here is the html
<div id="YJYSC_container<?php echo $container_poz ?>" style="height:<?php echo $slider_height ?>px; width:<?php echo $slider_width ?>px;">
<!-- navigator -->
<div id="navigator_outer" style="height:<?php echo $slider_height ?>px; width:<?php echo $thumb_width +30 ?>px;">
<ul id="navigator">
<?php foreach ($yousclides as $youscslide):?>
<li class="element" style="height:<?php echo $slider_height / $visibleItems ?>px">
<div class="inner" style="width:<?php echo $thumb_width + 30 ?>px;height:<?php echo $slider_height / $visibleItems ?>px">
<div class="inner_over" style="width:<?php echo $thumb_width +30 ?>px;height:<?php echo $slider_height / $visibleItems -12 ?>px">
<div class="border_out" style="height:<?php echo $slider_height / $visibleItems -20 ?>px;width:<?php echo $thumb_width + 0 ?>px;">
<div class="border_in" style="height:<?php echo $slider_height / $visibleItems -20 ?>px;width:<?php echo $thumb_width + 0 ?>px;">
<?php if($youscslide['img_url'] != "") echo $youscslide['img_tumb']; ?>
</div>
</div>
</div>
</div>
</li>
<?php endforeach;?>
</ul>
</div>
<!-- end of navigator, start slides -->
<div id="slides" style="height:<?php echo $slider_height ?>px; width:<?php echo $slider_width ?>px;">
<?php foreach ($yousclides as $youscslide):?>
<div class="slide" style="height:<?php echo $slider_height ?>px; width:<?php echo $slider_width ?>px;"> <a href="<?php echo $youscslide['link'] ?>" title="">
<?php if($youscslide['img_url'] != "") echo $youscslide['img_out'] ?>
</a>
<div class="long_desc" style="width:<?php echo $intro_desc_width ?>;height:<?php echo $intro_desc_height ?>;<?php echo $intro_desc_pozi ?>">
<h1><?php echo $youscslide['title'] ?></h1>
<?php echo $youscslide['intro'] ?> <?php echo JText::_('YOUSC_READ') ?> </div>
</div>
<?php endforeach;?>
</div>
</div>
Use this:
#media screen and (max-width: 900px) {
#YJYSC_container, #YJYSC_container_l {
width: 100% !important;
height: auto !important;
}
#YJYSC_container_l #navigator_outer {
position: relative !important;
width: 100% !important;
height: auto !important;
margin-bottom: 20px;
}
#YJYSC_container #slides, #YJYSC_container_l #slides {
width: 100% !important;
}
#YJYSC_container #slides div.slide, #YJYSC_container_l #slides div.slide {
width: 100% !important;
}
#YJYSC_container #navigator li.element div.inner, #YJYSC_container_l #navigator li.element div.inner,
#YJYSC_container #navigator li.element div.inner_over, #YJYSC_container_l #navigator li.element div.inner_over,
#YJYSC_container_l #navigator li.element div.inner div.inner_over .border_out,
#YJYSC_container #navigator li.element div.inner div.inner_over .border_in, #YJYSC_container_l #navigator li.element div.inner div.inner_over .border_in,
#YJYSC_container #navigator li.element div.inner div.inner_over .border_in, #YJYSC_container_l #navigator li.element div.inner div.inner_over .border_in img{
width: 100% !important;
height: auto !important;
float: none !important;
}
#YJYSC_container #navigator li.element, #YJYSC_container_l #navigator li.element {
float: left;
width: 33% !important;
height: auto !important;
clear: none !important;
}
#YJYSC_container #navigator, #YJYSC_container_l #navigator {
overflow: auto !important;
}
}
This code triggers on devices with width under 900px. It still needs more work, but responsivity is starting to make sense.
Updated jsfiddle:
http://jsfiddle.net/gg9mvtrt/1/
This is how my website looks in Google Chrome and nearly all browsers except some versions of IE.
This is how it looks in IE8, IE9 and probably in IE6.
The funny thing is that the website looks ABSOLUTELY ok in IE7. I want you to help me solve the problem, but I don't really know which data to server you, but if you ask, I can provide everything you need.
Here's the header code:
<div id="header">
<div id="headercont">
<div id="headerlogo">
<img src="<?php echo dir;?>css/images/headerbg.png" class="header" />
</div>
<div id="menu">
<div id="mpointshighlight">
<div id="menupoints">
<?php echo menuSpace; ?>
<div id="menumain">Main</div>
<?php echo menuSpace; ?>
<div id="menuabout">About</div>
<?php echo menuSpace; ?>
<div id="menublog">Blog</div>
<?php echo menuSpace; ?>
<div id="menuphotos">Photos</div>
<?php echo menuSpace; ?>
<div id="menuvideos">Videos</div>
<?php echo menuSpace; ?>
<div id="menumusic">Music</div>
<?php echo menuSpace; ?>
<div id="menuprojects">Projects</div>
</div>
</div>
</div>
</div>
</div>
Here's the header CSS:
#header {
background-color:#00a2ff;
background-image:url('images/menubg.png');
background-repeat:repeat-x;
background-position:bottom;
width:100%;
min-width:1100px;
height:243px;
}
#headercont {
margin:auto;
width:1100px;
}
#headerlogo {
margin:auto;
width:1000px;
}
#menu {
width:100%;
height:44px;
}
#menupoints {
position:relative;
width:1000px;
font-size:24px;
font-family:verdana;
height:44px;
}
#mpointshighlight {
margin:auto;
width:1000px;
margin-bottom:10px;
background-repeat:no-repeat;
}
#menupoints a:link {
color:white;
text-decoration:none;
text-shadow: black 2px 2px 3px;
}
#menupoints a:visited {
color:white;
text-decoration:none;
text-shadow: gray 2px 2px 3px;
}
#menupoints a:hover {
color:white;
text-decoration:none;
text-shadow: black 2px 2px 3px, white 0 0 1em;
}
#menupoints a:active {
}
#menumain {
display:inline
}
#menuabout {
display:inline
}
#menublog {
display:inline
}
#menuphotos {
display:inline
}
#menuvideos {
display:inline
}
#menumusic {
display:inline
}
#menuprojects {
display:inline
}
Hard to be certain what the problem is without going into depth, but something that might help is to look into compatibility modes in IE:
http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx
Specifically, tell IE8 and higher to emulate IE7:
Ensure this is the first HTML tag in the head.
As for IE6, depending on your target audience, you might be able to get away with ignoring it, otherwise it's a trawl through CSS I'm afraid!
Need help to solve some resolution issues on a project i'm currently working on.
Have a look here http://viewlike.us/?url=tinyurl.com%2Fsoreso&button.x=75&button.y=17&button=Submit
The css/layout was done as a liquid layout but as you can notice the columnns and the search box on the right start overlapping from 800*600 onwards.
At higher resolutions say 1920*1200 it starts looking a bit ugly particularly the search box on the right looks a bit stretched.
The site looks ok only when viewed at 1200*800 or at the next resolution.
What can i do to both
1)Make it work for 800*600 and above
2)Prevent it from looking ugly at higher resolutions
I'm also thinking about adding a media queries specific style sheet to make this work for smartphones, tablets etc.
Here's both the page and the css for it
index.php
<html>
<body>
<div id="wrap">
<div id="header">
<?php include("header.inc.php"); ?>
<div id="menu" align="left">
<div class="top_menu_left">
<li><?php echo $lang['HOME_LINK']; ?></li><li>|</li>
<li>Subscribe</li>
</div>
<?php if($auth->id) { ?>
<div class="top_menu_right">
<li>My Account</li><li>|</li>
<li>Watch List</li><li>|</li>
<li>Logout</li>
<?php }else{ ?>
<li>Login</li><li>|</li>
<li>Sign up</li>
</div>
<?php } ?>
</div>
</div>
<!--END OF MENU DIV CONTENT-->
<div align="center"><div id="bar"></div></div><br />
</div>
<div id="content">
<div id="left_content"> <?php include('left_sidebar.php'); ?> </div>
<div id="main_content">
<?php include("path.inc.php"); ?>
<div style="display:none;"><?php echo "<!--#&88;#&90;#&101;#&114;#&111;".
"#&83;#&99;#&114;#&105;#&112;#&116;#&115;#&46;#&99;#&111;#&109;-->"; ?></div>
<?php echo $content;unset($content);?>
</div>
<div id="right_content">
<?php
if($xview != "post" && $xview != "postimg")
{
?>
<div class="right_top" align="center"><?php echo $lang['SEARCH']; ?> <?php include("search.inc.php"); ?> </div>
<?php
}
?>
</div>
</div>
<div style="clear:both" ></div>
<div style="clear:both" ></div>
<div id="footer" align="center">
<div class="footer_menu">
<li>About us</li> <li>|</li>
<li><?php echo $lang['TERMS_OF_USE']; ?></li><li>|</li>
<li><?php echo $lang['PRIVACY_POLICY']; ?> </li><li>|</li>
<li>Contact us</li> <li>|</li>
</div>
<div class="footer_menu2">
<strong>Copyright © 2011 <?php if(($y=date("Y")) != 2011) echo "- $y"; ?> <?php echo $site_name; ?>. All Rights Reserved </strong>
</div>
</div>
</div>
</body>
</html>
Style.css
html { -webkit-text-size-adjust: 70%; }
body { margin:0px; padding:0px;font-family:Arial, Helvetica, sans-serif; }
b { font-size:14px;}
#wrap { width:100%; height:100%; background-color:#FFFFFF; padding: 0;}
#header {
padding: 10px;
height:251px;
}
#menu { width:100%; height:2.2em; margin-top:1%; background:#80b2e4; border- radius:10px; -moz-border-radius:10px; -webkit-moz-border-radius:10px;}
.top_menu_left {float:left; width:86%;height:35px; margin-left:3%;}
.top_menu_left li a { color:#fff !important; }
.top_menu_left li a:hover { color:#336699 !important; }
.top_menu_right {float:right; width:17%;;height:1.2em;}
li{list-style:none; float:left; color:#74677E;font-size:70%;font- weight:bold;font- family:Arial, Helvetica, sans-serif; text-align:left; padding:0 5px; -top:9px; color:#fff;}
.top_menu_left li {padding-right:1%; color:#fff;}
.top_menu_right li {padding-right:5%; color:#fff;}
#searchbar { width:100%; height:auto;margin-top:8%;}
#top_search {width:100%; height:auto;}
#bottom_search {width:89%; height:auto;padding-left:10.5%;font-size:75%;}
.sarch_box { width:10%; height:auto; float:left; margin-left:1%;font-size:75%;}
.box_1 { width:20%; height:auto; float:left;font-size:85%;}
box_1 input { width:80%; height:1.2em;font-size:85%;}
.box_1 select { width:70%; height:1.5em;font-size:85%;}
.box_2 {width:2%; height:auto; float:left;}
#content { width:87%; height:auto; margin-left:11%; margin-top:0; }
#left_content { width:7%; height:auto; float:left; }
#left_searchbar_title {width:95%;height:2%;padding-top:1%;padding-bottom:1%;padding- left:5%;background-color:#A5D959;font-family:Arial, Helvetica, sans-serif;font-size:75%;}
#left_sidebar_content{width:100%;height:2%;background-color:#EFFFD8;font-family:Arial, Helvetica, sans-serif;font-size:75%;}
#main_content { width:59%; height:auto;float:left; }
.main_content_header {margin-left:2%;color:black;font-size:100%;font- family:Arial, Helvetica, sans-serif;font-weight:bold;margin-bottom:5%;}
.content_header {width:70%; height:auto; margin-left:3%;}
/*.left_1 {margin-left:2%;width:.05em; height:100px;background- image:url(images/verticalbar.gif);background-repeat:repeat-y;float:left;padding-left:2px; }*/
.left_1 {margin-left:2%;width:.05em; height:100px;background-image:none;background- repeat:repeat-y;float:left;padding-left:2px; }
/*.left_6 { width:.05em;height:100px;background- image:url(images/verticalbar.gif);background-repeat:repeat-y;float:left; }*/
.left_6 { width:.05em;height:100px;background-image:none;background-repeat:repeat- y;float:left; }
.left_content_middle {width:95%;float:left;font-size:80%;font-family:Arial, Helvetica, sans-serif; background:white; border:1px solid #c6c6c6;border-radius:10px; webkit-border-radius:10px; -moz-border-radius:10px}
.content_title {padding:2%; text-align:center; color:black; <!--#336699;-->font-weight:bold;font-size:100%;font-family:Arial, Helvetica, sans-serif; }
.content_line{size:2px; width:95%; background-image:url(images/horizotal-line.gif);}
.left_2 { margin-left:3%; width:21.5%; height:auto; float:left; }
.left_3 { width:23.5%;height:auto;float:left;}
.left_4 { width:23.5%;height:auto;float:left;}
.left_5 { width:23.5%;height:auto;float:left;}
#right_content { width:20%;height:auto;background-color:white;float:left;margin- left:1%;padding:10px; border:1px solid #c6c6c6; border-radius:10px; webkit-border- radius:10px; -moz-border-radius:10px}
.right_top { width:100%; height:auto; color:white; font-size:100%; color:#336699;}
.Left_portion { width:45%; height:auto; float:left;padding-left:8%;}
.right_portion { width:45%; height:auto; float:left;}
.right_content_title {color:#BB532E;font-weight:bold;font-size:70%;font-family:Arial, Helvetica, sans-serif;padding-bottom:4%;padding-top:5%; }
.right_content_body {color:#5E6472;font-size:70%;font-weight:bold;font-family:Arial, Helvetica, sans-serif;padding-bottom:3%;}
.menu_bar { width:10%; font-family:Arial, Helvetica, sans-serif; color:red; float:left; font-size:50%;}
.gap {width:35%;}
#footer {height:40px;width:100%;margin:auto;text-align:center;text- align:center;margin-top:2%;background:url('images/footer_bg.png') repeat-x; line-height:40px; color:white;}
.footer_menu {
color: white;
float: right;
height: 1.2em;
-left: 3%;
width: 70%;
}
.footer_menu li {
color: white;
padding-right: 1%;
}
.footer_menu li a { color:#fff; text-decoration:none;}
.footer_menu li a:hover { text-decoration:underline}
.footer_menu2 {
background: url("images/footer_bg2.png") repeat-x scroll 0 0 transparent;
color: grey;
float: left;
font-size: 13px;
margin-top: 21px;
width: 100%;
}
.footer_menu strong { font-weight:lighter; color:#666}
Give max-width and min-width a try.
I'm guessing by liquid layouts you're using some form of percentages for it. In which case after a certain size the columns etc will be getting too large.
You will also most likely want to try min-width to stop the columns overlapping each other. You can prevent the text from going into the other columns by using overflow:hidden, however you would probably be better off just making the column have a minimum width and making the font-size smaller.
http://reference.sitepoint.com/css/max-width
http://reference.sitepoint.com/css/min-width