Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Zon
    Zon is offline
    Junior Member
    Join Date
    Aug 2012
    Posts
    1
    Member #
    32450
    Hello peeps
    I am trying ( hoping) to create my website and have a few questions regarding layout and styling. i am trying to create boxed area on my page and i have done most of the code apart from aligning the boxes in a row and where to put font stlying code.

    the code i have is :

    <!DOCTYPE html>
    <html>
    <head>
    <style type="text/css">
    div.ex
    {
    float:left;
    width:300px;
    height:200px;
    padding:10px;
    border:1px solid grey;
    margin:5px;
    margin-top:0px;

    webkit-border-radius: 30px;
    moz-border-radius: 30px;border-radius: 30px;background-color:#F0EEED;
    }
    </style>
    </head>

    <body>
    <img src="250px.gif" width="250" height="1" /><br /><br />

    <div class="ex">A & P facilities.<br />
    </div>

    <html>
    <head>
    <style type="text/css">
    div.ex
    {
    float:left;
    width:300px;
    height:200px;
    padding:10px;
    border:1px solid grey;
    margin:5px;
    margin-left:350px;

    webkit-border-radius: 30px;
    moz-border-radius: 30px;border-radius: 30px;background-color:#F0EEED;
    }
    </style>
    </head>

    <body>
    <img src="250px.gif" width="250" height="1" /><br /><br />

    <div class="ex">A & P facilities.<br />
    </div>

    basically i want three boxes in a row. thank you i advance for the help.

  2.  

  3. #2
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Quote Originally Posted by Zon, post: 240196
    Hello peeps
    I am trying ( hoping) to create my website and have a few questions regarding layout and styling. i am trying to create boxed area on my page and i have done most of the code apart from aligning the boxes in a row and where to put font stlying code.
    You have your CSS all mixed up with your HTML and you have mistakes in the HTML.
    You can't have 2 divs named the same and have different styles for them. Each div that has a specific style has to have a specific name, that is not duplicated anywhere. If you want to specify a style for only one div, use an id rather than a class.
    If you want to position the image with the text, it has to be inside the div.
    It's best to keep the CSS in a separate file whenever you can, both for speed of loading and for ease of editing.
    Try your HTML like this:

    HTML Code:
    <!DOCTYPE html>
    <html>
    <link rel="stylesheet" type="text/css" href="style.css" /> (this is the link to the external stylesheet)
    </head>
    
    <body>
    
    <div id="ex1"><img src="250px.gif" width="250" height="1" /><br /><br />
    <p>A & P facilities.</p><br />
    </div>
    
    <div id="ex2"><img src="250px.gif" width="250" height="1" /><br /><br />
    <p>A & P facilities.</p><br />
    </div>
    
    <div id="ex3"><img src="250px.gif" width="250" height="1" /><br /><br />
    <p>A & P facilities.</p><br />
    </div>
    
    </body>
    </html>
    And your CSS like this:
    Code:
    @charset "utf-8";
    /* CSS Document */
    
    #ex1
    {
    float:left;
    width:300px;
    height:200px;
    padding:10px;
    border:1px solid grey;
    margin:0px 5px 15px 20px;
    webkit-border-radius: 30px;
    moz-border-radius: 30px;
    border-radius: 30px;
    background-color:#F0EEED;
    font: italic 18px "Monotype Corsiva", "Baskerville Old Face", "Century Schoolbook", serif;
    color: #00F;
    }
    
    #ex2
    {
    float:left;
    width:300px;
    height:200px;
    padding:10px;
    border:1px solid grey;
    margin:0px 5px 15px 20px;
    webkit-border-radius: 30px;
    moz-border-radius: 30px;
    border-radius: 30px;
    background-color:#F0EEED;
    font: italic 18px Verdana, Geneva, sans-serif;
    color: #0F0;
    }
    
    #ex3
    {
    float:left;
    width:300px;
    height:200px;
    padding:10px;
    border:1px solid grey;
    margin:0px 5px 15px 20px;
    webkit-border-radius: 30px;
    moz-border-radius: 30px;
    border-radius: 30px;
    background-color:#F0EEED;
    font: italic 18px "Palatino Linotype", "Book Antiqua", Palatino, serif;
    color: #F00;
    }
    I've made each box have a different font and color, so you can see how the styling works.
    See the example here. http://www.digitalinsite.ca/dev/boxesZon/

    I think you really need to go back a bit and study HTML and CSS - your mistakes indicate to me that you don't understand how they work.
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:59 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com