0

I am trying to create and align three boxes with 1px solid border under the MENU. I want them to be aligned equally under as I am planning of putting images in them. Three in each row. I can create the first div box and align it, but when I try to create another one, it just overlaps the first one and I can't get it to move in-line to the next one. The dimensions are "height" 340px and "width" 260px. Because I will BE USING this format again do I create them as a div class or div ID. Please can someone explain in detail. Much appreciated.

Appreciate all the help guys. Thanks.

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="videos.css" />
<link rel="stylesheet" type="text/css" href="vines.css" />
<title>Puppy Power</title>
</head>
<body>
        <div id="page">
<header></header>
        <div id="dog logo">
    </div>

<ul id="navigation">
        <li><a href="indes.html">Home</a></li>
        <li><a href="Videos.html">Videos</a>
            <ul class="sub">
                <li><a href="#">Vines</a></li>
                <li><a href="#">Pugs</a></li>
                <li><a href="#">Failing Dogs</a></li>
                <li><a href="#">Crazy Dogs</a></li>
                <li><a href="#">Funny Dogs</a></li>

            </ul>
        </li>


        <li><a href="#">Photographs</a></li>    
        <li><a href="#">Articles</a></li>
        <li><a href="#">Contact</a></li>
    </ul>

<div class="row">
    <div class="cell"></div>
    <div class="cell"></div>
    <div class="cell"></div>

#row {
    width: 267px;
    height: 370px;
    border-top: 1px solid #89cff0;
    border-bottom: 1px solid #89cff0;
    border-left: 1px solid #89cff0;
    border-right: 1px solid #89cff0;
    display: inline-block;
    vertical-align:top;
    margin: 5px 0px 5px 5px;
}
G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129

2 Answers2

0

If I have not misunderstood your question this is probably what you are looking for:

<div class="row">
    <div class="cell"></div>
    <div class="cell"></div>
    <div class="cell"></div>
</div>

.cell {
    width: 267px;
    height: 370px;
    border: 1px solid #89cff0;
    display: inline-block;
    margin: 5px 0px 5px 5px;
}

Here's an example of how it will appear: http://codepen.io/anon/pen/xsKwq

I hope I was helpful

Lo.m
  • 1
  • 1
0

were you thinking of a dropdown menu?

I have a code for that:

<!DOCTYPE html>
<html>
<head>
    <title> Game </title>
<style>

body{
    padding: 0;
    margin: 0;
    overflow-y: scroll;
    font-family: Arial;
    font-size: 18px;
    background-color: rgb(232, 147, 0);
}

#nav{
    background-color: #333;
}
#nav_wrapper{
    width: 960px;
    margin: 0 auto;
    text-align: left;
}
#nav ul{
    list-style-type: none;
    padding: 0;
    margin: 0;
    position: relative;
}
#nav ul li{
    display: inline-block;
}
#nav ul li:hover{
    background-color: yellow;
}
#nav ul li a,visited{
    color: red;
    display: block;
    padding: 15px;
    text-decoration: none;
}
#nav ul li a:hover{
    color: blue;
    text-decoration: none;
}
#nav ul li:hover ul{
    display: block;
}
#nav ul ul{
    display: none;
    position: absolute;
    background-color: #333;
    border: 5px solid #222;
    border-top: 0px;
    margin-left: -5px;
} 
#nav ul ul li{
    display: block;
}
#nav ul ul li a,visited{
    color: red;
}
#nav ul ul li a:hover{
    color: #099;
}
</style>
</head>
<script>
</script>
<body>
    <h1> About the code </h1>
    <div id="nav">
        <div id="nav_wrapper">
            <ul>
                <li><a href="#">Game</a>
                    <ul>
                        <li><a href="C:/Users/Troike/Desktop/ScienceFairJavaScript/Ordinate.html">Play the game</a></li>
                        <li><a href="C:/Users/Troike/Desktop/ScienceFairJavaScript/HowToPlay.html">How to play</a></li>
                        <li><a href="C:/Users/Troike/Desktop/ScienceFairJavaScript/SourceCode.html">Source code</a></li>
                    </ul>
                </li><li>
                <a href="#">About the Creator</a></li>
            </ul>
    </div>
</body>
</html>

You can edit this code whether you want the menu to do something; otherwise you don't have to edit it.

Random Channel
  • 1,134
  • 10
  • 22