tags:

views:

67

answers:

4

The element part in the width that I appointed is in present state, it is started a new line on the way. How to break line by each element unit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>no title document</title>
<style type="text/css">
<!--
.sample {
    width: 220px;
}
-->
</style>
</head>
<body>
<div class="sample">
<a href="#">aaaa</a>
<a href="#">bbbb</a>
<a href="#">cc</a>
<a href="#">ddddd</a>
<a href="#">eee</a>
<a href="#">fff</a>
</div>
</body>
</html>
+1  A: 

Not sure if this is what you mean but you can use <br/> tags

<body>
<div class="sample">
<a href="#">aaaa</a><br/>
<a href="#">bbbb</a><br/>
<a href="#">cc</a><br/>
<a href="#">ddddd</a><br/>
<a href="#">eee</a><br/>
<a href="#">fff</a><br/>
</div>
AutomatedTester
+1  A: 

Use unordered list instead of this!

  • element
  • element
  • element
  • element

If you explicit want a linebreak, mark up a br, or set display: block css parameter to the 'a' tags.

.sample a{
      display: block;
}
erenon
A list is the best solution, but the OP probably doesn't want bullet points or indentation, in which case you need to add `list-style:none` on the `li` element, and `padding:0` on the `ul` element.
DisgruntledGoat
+1  A: 

Use display: block for <a>:

<!--
    .sample {
        width: 220px;
    }

    .sample a {
        display: block;
    }
-->
eu-ge-ne
A: 

Convert the <a> elements into block. Block elements will break unless floated.

Add this into your CSS or style:

a { display: block; }
Adrian Godong