Click to See Complete Forum and Search --> : Making this sentence flow inline


Anchjer
05-20-2005, 12:08 PM
I know this may seem like a weird question, but it’s building up to something.

I need to make this line of code:

<p>Although <ul id="nav"><li>Victor Hugo</li></ul> is better known as a novelist, it was as a poet that he broke new ground.</p>Appear normal and inline just like any normal sentence one might come across, like this:

"Although Victor Hugo is better known as a novelist, it was as a poet that he broke new ground."

Here’s the style I so far:

ul {padding: 0;margin: 0;list-style: none;}
li {float: left;position: relative;width:10em;}
li ul {display: none;position:absolute;top:1em;left:0;}
li > ul {top: auto;left: auto;}
li:hover ul, li.over ul{display: block;}

Thank you very much for any help!

BonRouge
05-20-2005, 12:25 PM
Would you like to explain why on Earth you're doing that?

Anchjer
05-20-2005, 01:03 PM
Seems like a really weird question I know.

What I’m trying to do is have an inline link that when clicked on, opens up some choices below.

This is the html I’m working on now, but the thing is, the “Victor Hugo” part breaks the line and has a big gap behind the text. I’m trying to style it so it flows inline.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Victor Hugo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style>
ul {padding: 0;margin: 0;list-style: none;}
li {float: left;position: relative;width:10em;}
li ul {display: none;position:absolute;top:1em;left:0;}
li > ul {top: auto;left: auto;}
li:hover ul, li.over ul{display: block;}
</style>

<script type="text/javascript">startList = function() {if (document.all&&document.getElementById) {navRoot = document.getElementById("nav");for (i=0; i<navRoot.childNodes.length; i++) {node = navRoot.childNodes[i];if (node.nodeName=="LI") {node.onmouseover=function() {this.className+=" over";};node.onmouseout=function() {this.className=this.className.replace(" over", "")};};};};};window.onload=startList;</script>

</head>

<body>
<p>Although <ul id="nav"><li>Victor Hugo
<ul>
<li><a href="#">Biography</a></li>
<li><a href="#">Quotes</a></li>
</ul>
</li></ul> is better known as a novelist, it was as a poet that he broke new ground.</p>
</body>
</html>

bokeh
05-20-2005, 01:14 PM
ul {
list-style: none;
}

ul li {
display: inline;
}