Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Layout help please ! Urgent

    I cannot for the life of me work out these 2 problems.... any help will be great thanks

    1st ......
    Center aligning these images/div boxes ... I cant work it out at all, no matter what I try they will not center

    Layout help please ! Urgent-untitled.jpg

    2nd......
    Why is the menu messing up when viewing on my iphone ? how can I fix this

    Layout help please ! Urgent-img_3319.jpg

    Many thanks for your help guys


    Code:
    html, body
    {
    	height: 100%;
    	width: 100%;
    }
    
    body
    {
    	margin: 0px;
    	padding: 0px;
    	background: #743D46;
    	font-family: 'Source Sans Pro', sans-serif;
    	font-size: 11pt;
    	font-weight: 300;
    	color: #6c6c6c
    	width:100%;
    }
    
    h1, h2, h3
    {
    	margin: 0;
    	padding: 0;b
    	font-weight: 600;
    	color: #454445;
    }
    
    p, ol, ul
    {
    	margin-top: 0;
    }
    
    ol, ul
    {
    	padding: 0;
    	list-style: none;
    }
    
    p
    {
    	line-height: 180%;
    	color: #FFF;
    }
    
    strong
    {
    	color: #FFFFFF;
    	font-size: 16pt;
    }
    
    a
    {
    	color: #743D46;
    }
    
    a:hover
    {
    	text-decoration: none;
    }
    
    .container
    {
    	margin: 0px auto;
    	width: auto;
    	alignment-adjust: central;	
    }
    
    /*********************************************************************************/
    /* Image Style                                                                   */
    /*********************************************************************************/
    
    	.image
    {
    	display: inherit;
    }
    
    .image img
    {
    	display: block;
    	width: 100%;
    }
    
    .image-full
    {
    	display: block;
    	width: 100%;
    	margin: 0 0 2em 0;
    }
    
    .image-left
    {
    	float: left;
    	margin: 0 2em 2em 0;
    }
    
    .image-centered
    {
    	display: block;
    	margin: 0 0 2em 0;
    }
    
    .image-centered img
    {
    	margin: 0 auto;
    	width: auto;
    }
    
    /*********************************************************************************/
    /* List Styles                                                                   */
    /*********************************************************************************/
    
    	ul.style1
    {
    	margin: 0;
    	padding: 0em 0em 0em 0em;
    	overflow: hidden;
    	list-style: none;
    	color: #6c6c6c
    }
    
    ul.style1 li
    {
    	overflow: hidden;
    	display: block;
    	padding: 2.80em 0em;
    	border-top: 1px solid #D1CFCE;
    }
    
    ul.style1 li:first-child
    {
    	padding-top: 0;
    	border-top: none;
    }
    
    ul.style1 .image-left
    {
    	margin-bottom: 0;
    }
    
    ul.style1 h3
    {
    	padding: 1.2em 0em 1em 0em;
    	letter-spacing: 0.10em;
    	text-transform: uppercase;
    	font-size: 1.2em;
    	font-weight: 600;
    	color: #454445;
    }
    
    ul.style1 a
    {
    	text-decoration: none;
    	color: #525252;
    }
    
    ul.style1 a:hover
    {
    	text-decoration: underline;
    	color: #525252;
    }
    
    ul.style2
    {
    	margin: 0;
    	padding-top: 1em;
    	list-style: none;
    }
    
    ul.style2 li
    {
    	border-top: solid 1px #E5E5E5;
    	padding: 0.80em 0 0.80em 0;
    	font-family: 0.80em;
    }
    
    ul.style2 li:before
    {
    	display: inherit;
    	padding: 4px;
    	background: #DB3256;
    }
    
    ul.style2 a
    {
    	display: inherit;
    	margin-left: 1em;
    }
    
    ul.style2 li:first-child
    {
    	border-top: 0;
    	padding-top: 0;
    }
    
    ul.style2 .icon
    {
    	color: #FFF;
    }
    
    ul.style3
    {
    	margin: 0;
    	padding-top: 1em;
    	list-style: none;
    }
    
    ul.style3 li
    {
    	border-top: solid 1px rgba(255,255,255,.2);
    	padding: 1em 0 1em 0;
    	font-family: 0.80em;
    }
    
    ul.style3 li:before
    {
    	display: inherit;
    	padding: 4px;
    	background: #FFF;
    }
    
    ul.style3 a
    {
    	display: inherit;
    	margin-left: 1em;
    	font-size: 1em !important;
    	color: #FFF;
    }
    
    ul.style3 li:first-child
    {
    	border-top: 0;
    	padding-top: 0;
    }
    
    ul.style3 .icon
    {
    	color: #DB3256;
    }
    
    /*********************************************************************************/
    /* Social Icon Styles                                                            */
    /*********************************************************************************/
    
    	ul.contact
    {
    	margin: 0;
    	padding: 2em 0em 0em 0em;
    	list-style: none;
    }
    
    ul.contact li
    {
    	display: inherit;
    	padding: 0em 0.30em;
    	font-size: 1em;
    }
    
    ul.contact li span
    {
    	display: none;
    	margin: 0;
    	padding: 0;
    }
    
    ul.contact li a
    {
    	color: #FFF;
    }
    
    ul.contact li a:before
    {
    	display: inherit;
    	background: #3f3f3f;
    	width: 40px;
    	height: 40px;
    	line-height: 40px;
    	border-radius: 20px;
    	text-align: center;
    	color: #FFFFFF;
    }
    
    ul.contact li a.icon-twitter:before
    {
    	background: #2DAAE4;
    }
    
    ul.contact li a.icon-facebook:before
    {
    	background: #39599F;
    }
    
    ul.contact li a.icon-dribbble:before
    {
    	background: #C4376B;
    }
    
    ul.contact li a.icon-tumblr:before
    {
    	background: #31516A;
    }
    
    ul.contact li a.icon-rss:before
    {
    	background: #F2600B;
    }
    
    /*********************************************************************************/
    /* Button Style                                                                  */
    /*********************************************************************************/
    
    	.button
    {
    	display: inline-block;
    	padding: 1.3em 3em;
    	background: #743D46;
    	-moz-transition: opacity 0.25s ease-in-out;
    	-webkit-transition: opacity 0.25s ease-in-out;
    	-o-transition: opacity 0.25s ease-in-out;
    	-ms-transition: opacity 0.25s ease-in-out;
    	transition: opacity 0.25s ease-in-out;
    	letter-spacing: 0.2em;
    	text-decoration: none;
    	text-transform: uppercase;
    	font-weight: 600;
    	color: #FFF;
    }
    
    .button:hover
    {
    }
    
    .button:active
    {
    }
    
    .button-big
    {
    	padding: 1.6em 4em;
    	font-size: 1.4em;
    	font-weight: 900;
    }
    
    /*********************************************************************************/
    /* Heading Titles                                                                */
    /*********************************************************************************/
    
    	.title
    {
    	margin-bottom: 3em;
    }
    
    .title h2
    {
    	font-weight: 400;
    	font-size: 2.8em;
    	color: #323232;
    }
    
    .title .byline
    {
    	letter-spacing: 0.15em;
    	text-transform: uppercase;
    	font-weight: 400;
    	font-size: 1.1em;
    	color: #6F6F6F;
    }
    
    /*********************************************************************************/
    /* Header                                                                        */
    /*********************************************************************************/
    	
    #header-wrapper
    {
    	background: #FFF;
    }
    
    #header
    {
    	position: relative;
    	height: 100px;
    }
    
    /*********************************************************************************/
    /* Logo                                                                          */
    /*********************************************************************************/
    
    {
    	position: absolute;
    	top: 2em;
    	left: 0;
    	width: 100%;
    }
    
    #logo h1
    {
    	display: inline-block;
    	font-size: 2.5em;
    	text-transform: uppercase;
    	font-weight: 700;
    	color: #2C383B;
    	padding-top: 0.5em;
    	padding-left: 0.5em;
    	padding-right: 0.5em;
    	border-right: 1px solid rgba(0,0,0,.3);
    }
    
    #logo span
    {
    	position: absolute;
    	top: 22px;
    	display: inline-block;
    	padding-left: 1.5em;
    	padding-top: 0.3em;
    	letter-spacing: 0.1em;
    	text-transform: uppercase;
    	font-size: 0.9em;
    	left: 100px;
    	width: 57px;
    	height: 56px;
    	color: #660000;
    }
    
    #logo a
    {
    	text-decoration: none;
    	color: #743D46;
    }
    
    /*********************************************************************************/
    /* Menu                                                                          */
    /*********************************************************************************/
    
    #menu
    {
    	position: absolute;
    	right: 0;
    	top: 1em;
    }
    
    #menu ul
    {
    	display: inline-block;
    }
    
    #menu li
    {
    	display: block;
    	float: left;
    	text-align: center;
    	line-height: 60px;
    }
    
    #menu li a, #menu li span
    {
    	display: inline-block;
    	margin-left: 1px;
    	padding: 0em 1.5em;
    	letter-spacing: 0.1em;
    	text-decoration: none;
    	font-size: 1em;
    	text-transform: uppercase;
    	outline: 0;
    	color: #FFFFFF;
    	background: #743D46;
    }
    
    #menu li:hover a, #menu li.active a, #menu li.active span
    {
    }
    
    #menu .current_page_item a
    {
    	background: #383838;
    	color: #FFF;
    }
    
    #menu .icon
    {
    }
    
    /*********************************************************************************/
    /* Banner                                                                        */
    /*********************************************************************************/
    	
    	#banner-wrapper
    {
    	overflow: visible;
    	padding: 3em 0em;
    	background: #743D46;
    }
    
    #banner
    {
    	overflow: visible;
    	width: 100%;
    	text-align: center;
    	color: rgba(255,255,255,.7);
    }
    
    #banner a
    {
    	color: rgba(255,255,255,.9);
    }
    
    #banner .box-left
    {
    	float: left;
    }
    
    #banner .box-right
    {
    	float: right;
    }
    
    #banner h2
    {
    	margin: 0em;
    	padding: 0em;
    	font-weight: 400;
    	font-size: 3em;
    	color: #555555;
    }
    
    #banner span
    {
    	display: inline-block;
    	padding-top: 0.2em;
    	text-transform: uppercase;
    	font-size: 1.2em;
    	color: #A2A2A2;
    }
    
    /*********************************************************************************/
    /* Page                                                                          */
    /*********************************************************************************/
    
    #wrapper
    {
    	background: #FFF;
    	width: 100%;
    }
    
    #page
    {
    	overflow: visible;
    	padding: 6em 0em;
    	border-bottom: 2px solid #E3E3E3;
    	text-align: center;
    }
    
    #page .button
    {
    	margin-top: 2em;
    }
    
    /*********************************************************************************/
    /* Content                                                                       */
    /*********************************************************************************/
    
    #content
    {
    	padding: 0em 7em;
    }
    
    /*********************************************************************************/
    /* Sidebar                                                                       */
    /*********************************************************************************/
    
    	#sidebar
    {
    	float: right;
    	width: 100%;
    }
    
    #stwo-col
    {
    	margin-top: 2em;
    }
    
    #stwo-col h2
    {
    	display: block;
    	padding-bottom: 1.5em;
    	letter-spacing: 0.10em;
    	text-transform: uppercase;
    	font-size: 1.2em;
    	font-weight: 600;
    	color: #454445;
    }
    
    #stwo-col .sbox1
    {
    	float: left;
    	width: 210px;
    }
    
    #stwo-col .sbox2
    {
    	float: right;
    	width: 210px;
    }
    
    /*********************************************************************************/
    /* Copyright                                                                     */
    /*********************************************************************************/
    
    #copyright
    {
    	overflow: hidden;
    	padding: 5em 0em;
    	border-top: 1px solid rgba(255,255,255,0.08);
    }
    
    #copyright p
    {
    	letter-spacing: 0.20em;
    	text-align: center;
    	text-transform: uppercase;
    	font-size: 0.80em;
    	color: rgba(255,255,255,0.3);
    }
    
    #copyright a
    {
    	text-decoration: none;
    	color: rgba(255,255,255,0.6);
    }
    
    /*********************************************************************************/
    /* Featured                                                                      */
    /*********************************************************************************/
    
    #featured-wrapper
    {
    	overflow: visible;
    	padding: 6em 0em;
    	background: #383838;
    	text-align: center;
    	width: 100%;
    }
    
    #featured
    {
    	overflow: hidden;
    	text-align: center;
    }
    
    #featured .major
    {
    	overflow: visible;
    	margin-bottom: 3em;
    	padding-bottom: 2em;
    	border-bottom: 1px solid #E8E8E8;
    }
    
    #featured .major h2
    {
    	font-size: 3em;
    }
    
    #featured .major .byline
    {
    	font-size: 1.3em;
    }
    
    #featured .title
    {
    	margin-bottom: 1.5em;
    	padding-bottom: 1.5em;
    	border-bottom: 1px solid rgba(255,255,255,.1);
    }
    
    #featured .title h2
    {
    	font-size: 1.2em;
    }
    
    #featured h2
    {
    	text-align: center;
    	color: #FFF;
    }
    
    #featured .icon
    {
    	position: relative;
    	display: inherit;
    	width: 100px;
    	height: 100px;
    	background: #E24E2A;
    	margin: 0px auto 20px auto;
    	line-height:  100px;
    	font-size: 3em;
    	text-align: center;
    	color: #FFF;
    }
    
    .column1,  .column2,  .column3,  .column4
    {
    	width: 282px;
    	alignment-adjust:middle;
    	
    	
    }
    
    .column1,  .column2
    {
    	float: left;
    	margin-right: 24px;
    	align: center;
    }
    
    .column3
    {
    	float: left;
    	align: center;
    }
    
    .column4
    {
    	float: left;
    	align: center;
    }
    
    
    	#header-featured
    	{
    		height: 30em;
    		background-image: url(images/cellar1.jpg);
    		background-position: center;
    		background-size: cover;
    	}
    
    
    #slider-wrapper
    {
    	padding: 6em 0em;
    	background: #DB3256;
    }
    
    #slider
    {
    	margin: 0em auto 0em auto;
    	width: 100%;
    	position: relative;
    }
    
    #slider .button
    {
    }
    
    #slider .button:hover
    {
    }
    
    #slider .viewer
    {
    	width: 100%;
    	height: 375px;
    	margin: 0 auto;
    	overflow: visible;
    }
    
    #slider .viewer .reel
    {
    	display: none;
    	height: 375px;
    }
    
    #slider .viewer .reel .slide
    {
    	position: relative;
    	width: 1000px;
    	height: 375px;
    }
    
    #slider .viewer .reel h2
    {
    	position: absolute;
    	top: 130px;
    	left: 0;
    	width: 1200px;
    	height: 80px;
    	line-height: 80px;
    	background: #111111;
    	text-align: center;
    	opacity: 0.85;
    	font-weight: normal;
    	color: #ffffff;
    	font-size: 2.25em;
    }
    
    #slider .viewer .reel p
    {
    	position: absolute;
    	top: 210px;
    	left: 0;
    	width: 1200px;
    	height: 40px;
    	line-height: 40px;
    	background: #0074C6;
    	text-align: center;
    	opacity: 0.85;
    	font-weight: normal;
    	color: #ffffff;
    	font-size: 1.1em;
    }
    
    #slider .icon
    {
    	font-size: 4em;
    	color: #FFF;
    }
    
    #slider .previous-button
    {
    	position: absolute;
    	top: 150px;
    	left: 0;
    }
    
    #slider .next-button
    {
    	position: absolute;
    	top: 150px;
    	right: 0;
    }
    
    #slider .indicator
    {
    	margin: 30px auto 0 auto;
    }
    
    #slider .indicator ul
    {
    	list-style: none;
    	padding: 0;
    	margin: 0;
    	text-align: center;
    }
    
    #slider .indicator ul li
    {
    	display: inherit;
    	width: 12px;
    	height: 12px;
    	text-indent: -9999em;
    	background: #c8c8c8;
    	margin: 0 2px 0 2px;
    	border-radius: 8px;
    	border-bottom: solid 1px #ffffff;
    	border-top: solid 1px #909090;
    }
    
    #slider .indicator ul li.active
    {
    	background: #505050;
    	border-top: solid 1px #505050;
    }
    
    /*********************************************************************************/
    /* Footer                                                                        */
    /*********************************************************************************/
    
    
    #footer-wrapper
    {
    	overflow: hidden;
    	padding: 6em 0em;
    	background: #383838;
    	text-align: center;
    	width: 100%;
    }
    
    #footer
    {
    	overflow: hidden;
    }
    
    
    #footer .title h2
    {
    	font-size: 1.6em;
    	font-weight: 300;
    	color: #FFF;
    }
    
    #footer .title .byline
    {
    	display: block;
    	padding-top: 1em;
    	text-transform: uppercase;
    	font-size: 0.80em;
    	color: rgba(255,255,255,0.5);
    }
    
    #footer .button
    {
    	margin-top: 2em;
    }
    
    #extra
    {
    	overflow: visible;
    	margin: 0em auto 0em auto;
    	padding: 5em 0em 5em 0em;
    	text-align: center;
    }
    
    #extra h2
    {
    	margin: 0em;
    	padding: 0em;
    	font-weight: 400;
    	font-size: 2.4em;
    	color: #555555;
    }
    
    #extra span
    {
    	display: block;
    	padding-top: 0.20em;
    	text-transform: uppercase;
    	font-size: 1.2em;
    	color: #A2A2A2;
    }
    
    
    #extra .button
    {
    	margin-top: 2em;
    }
    
    #extra2
    {
    	overflow: hidden;
    	padding-bottom: 5em;
    }
    
    #extra2 .button
    {
    	margin-top: 2em;
    }
    
    #extra2 .title h2
    {
    	font-size: 2em;
    }
    
    #extra2 .title .byline
    {
    	font-size: 0.80em;
    }
    
    #extra2 #ebox1,
    #extra2 #ebox2
    {
    	width: 560px;
    }
    
    #extra2  #ebox1
    {
    	float: left;
    }
    
    #extra2 #ebox2
    {
    	float: right;
    }

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,263
    Thanks
    10
    Thanked 277 Times in 276 Posts
    To center an object you need 1) a doctype 2) a width on the object and 3) left/right margins set to auto. You've got all but the width. Set your .container width to 1176px (the sum of the 4 boxes + margins in it).

    Phone, I don't have one to test. I don't think I saw any media queries in the above css, how is the site determining if you're on a phone?

  • #3
    New Coder
    Join Date
    Jul 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Managed to centre align it now.....


    still struggling with the menu, I basically want it to sit below the Logo when viewed on a mobile device... ideas ?

  • #4
    New Coder
    Join Date
    Jul 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <div id="header-wrapper">
    	<div id="header" class="container">
    		<div id="logo">
    		  <h1><a href="index.php"> CCS </a></h1>
    			<span>Cumbria Cellar Services</a></span> </div>
                
    		<div id="menu">
    			<ul>
    				<li class="current_page_item"><a href="index.php" accesskey="1" title="">Homepage</a></li>
    				<li><a href="cellar.php" accesskey="2" title="">Cellar/bar</a></li>
    				<li><a href="sales.php" accesskey="4" title="">Sales/Hire</a></li>
                    <li><a href="contact.php" accesskey="3" title="">Contact</a></li>
    				
    				
    			</ul>
    		</div>
    	</div>

    Maybe that will help, thats my layout of the top. How about putting it in a seperate div box so it sits below ?
    Any ideas ? Need this urgently

  • #5
    New Coder
    Join Date
    Dec 2013
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Are you using media queries in your css?

  • #6
    New Coder
    Join Date
    Dec 2013
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Because if you do you can declare different styles for different media and screen sizes


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •