Lists

  • Thread starter Luigi Donatello Asero
  • Start date
P

Paul Furman

Luigi said:
The following page has a table which contains the name of the provinces in
the region
http://www.scaiecat-spa-gigi.com/sv/toscana.html
I think I should have used a list though.
Can I write a list which looks like a table with different rows?

The setup for a horizontal list is bizzare. I just got it working so I
may misunderstand but aparently you need to set up the css for a list of
that style and a wrapper for it to sit in:

ul.menu {
display: inline;
list-style-type: none;
margin: 0;
}
#navigation li {
display: inline;
list-style-type: none;
margin: 0;
padding: 0;
}

<div id="navigation">
<ul class="menu">
<li><a href="index.php?">home</a></li>
<li> index.php?SCREEN=ecards.php">ecards</a></li>
</ul>
</div>

maybe it could have been:
<div>
<ul class="menu" id="navigation">
but that's how I saw a sample done


Simplified to only two items, as shown on the bottom of:
http://hills.ccsf.edu/~pfurma02/index.php?SCREEN=web-ref.php
home ecards class-links html-links about contact
This will wrap if it's squeezed in a narrow window & that would probably
make a mess of your table if you have headers.
 
L

Luigi Donatello Asero

Paul Furman said:
The setup for a horizontal list is bizzare. I just got it working so I
may misunderstand but aparently you need to set up the css for a list of
that style and a wrapper for it to sit in:

ul.menu {
display: inline;
list-style-type: none;
margin: 0;
}
#navigation li {
display: inline;
list-style-type: none;
margin: 0;
padding: 0;
}

<div id="navigation">
<ul class="menu">
<li><a href="index.php?">home</a></li>
<li> index.php?SCREEN=ecards.php">ecards</a></li>
</ul>
</div>

maybe it could have been:
<div>
<ul class="menu" id="navigation">
but that's how I saw a sample done


Simplified to only two items, as shown on the bottom of:
http://hills.ccsf.edu/~pfurma02/index.php?SCREEN=web-ref.php
home ecards class-links html-links about contact
This will wrap if it's squeezed in a narrow window & that would probably
make a mess of your table if you have headers.

How would you center the list under the header
"Provinser i Toscana" on the page
http://www.scaiecat-spa-gigi.com/sv/toscana.html
 
L

Luigi Donatello Asero

Paul Furman said:
Well, I used <center> but I think the following CSS is supposed to work
(or something along these lines):


margin-left: auto;
margin-right: auto;

Maybe applied to the div that contains them?

I used this style (38.css) at
http://www.scaiecat-spa-gigi.com/sv/test.html
but the list is still on the left
p{
margin-bottom: 2%;
margin-top: 2%;
text-indent:5%;
text-align: left;
margin-left:10%;
margin-right:10%;
}


TABLE { border-collapse: separate;
border: 1px solid red;
}

..one {color:#000000; border: 1px solid white;
background: #ffffff;}
..two {color:#000000; border: 1px solid white;
background: #33ffcc;}
..three {color:#000000; border: 1px solid white;
background: #99ff66;}
..four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
..five {color:#ffffff;
border: 1px solid white;
background: #ff0099;}






th, li, h1, h2, h3, a {
color: black;
background: transparent;
text-align:center;
}
body {
background: #ffffcc;
color: black;
font-size: 100%;
margin: 0;}
#head{border:0px solid white;}

#content{
margin-left:auto;
border:1px solid green;}
DIV.normal{margin-top: 5%;


}
div#menu{color:#000000;
background:#ffffcc;
width:25ex;



border:1px solid white;
text-align:center;



float:left;}
#menu a {
margin-left:auto;
margin-right: auto;
color: #0000ff;
background:#ffcc66;

border-left: 1px solid #F66460;
border-top: 1px solid #F66460;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
width: 80%;


margin-top: 5px;

display: block;}
#menu a:active {color: #0000ff; background-color:#ffffff; }
#menu a:visited {color: #000000; background-color:#ffffff;}
#menu a:hover {
color: #666666;
background-color:#ffffff;
border-left: 1px solid #000000;
border-top: 1px solid #000000;
border-right: 1px solid #F66460;
border-bottom: 1px solid #F66460;}
div.top {margin-top: 2%;
margin-left: auto;
margin-right:auto;
text-align:center;
}
div.bottom {margin-bottom: 2%;
margin-left: auto;
margin-right:auto;}
div.navigation
{
margin-left: auto;
margin-right:auto;
}
ul {
list-style: none;
margin-left: auto;


}
..menu {
display: inline;
list-style-type: none;
margin-left: auto;
margin-right:auto;
}
#navigation li {
display: inline;
list-style-type: none;

}


</style>
 
L

Luigi Donatello Asero

Els said:
"Paul Furman" <[email protected]> skrev i meddelandet

I used this style (38.css) at
http://www.scaiecat-spa-gigi.com/sv/test.html
but the list is still on the left

[snip stylesheet]

If you want to center something by using left and right
margins, you should also define a width.
Either define width and set the margins to auto, or define
the margins and set the width to auto.

I think you are right about the need of defininge a the margins and set
the width to auto or viceversa but the code which I wrote below and I used
as 38.css ( trying to get a better effect) is unfortunately not for a list
which does not have css bullets and is written horizontally. What is wrong
with it?

p{
margin-bottom: 2%;
margin-top: 2%;
text-indent:5%;
text-align: left;
margin-left:10%;
margin-right:10%;
}


TABLE { border-collapse: separate;
border: 1px solid red;
}

..one {color:#000000; border: 1px solid white;
background: #ffffff;}
..two {color:#000000; border: 1px solid white;
background: #33ffcc;}
..three {color:#000000; border: 1px solid white;
background: #99ff66;}
..four {
color:#ffffff; border: 1px solid white;
background: #cc6600;}
..five {color:#ffffff;
border: 1px solid white;
background: #ff0099;}






th, li, h1, h2, h3, a {
color: black;
background: transparent;
text-align:center;
}
body {
background: #ffffcc;
color: black;
font-size: 100%;
margin: 0;}
#head{border:0px solid white;}

#content{
margin-left:auto;
border:1px solid green;}
DIV.normal{margin-top: 5%;


}
div#menu{color:#000000;
background:#ffffcc;
width:25ex;



border:1px solid white;
text-align:center;



float:left;}
#menu a {
margin-left:auto;
margin-right: auto;
color: #0000ff;
background:#ffcc66;

border-left: 1px solid #F66460;
border-top: 1px solid #F66460;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
width: 80%;


margin-top: 5px;

display: block;}
#menu a:active {color: #0000ff; background-color:#ffffff; }
#menu a:visited {color: #000000; background-color:#ffffff;}
#menu a:hover {
color: #666666;
background-color:#ffffff;
border-left: 1px solid #000000;
border-top: 1px solid #000000;
border-right: 1px solid #F66460;
border-bottom: 1px solid #F66460;}
div.top {margin-top: 2%;
margin-left: auto;
margin-right:auto;
text-align:center;
}
div.bottom {margin-bottom: 2%;
margin-left: auto;
margin-right:auto;
}
div.ulmenu {
display: inline;
list-style-type: none;

margin:auto;
padding: 0;

text-align:center;
width:50%

}
#navigation li {
display: inline;
list-style-type: none;
}
ul {
list-style:none;
margin:auto;


}





</style>
 
E

Els

Luigi said:
Luigi said:
"Paul Furman" <[email protected]> skrev i meddelandet

I used this style (38.css) at
http://www.scaiecat-spa-gigi.com/sv/test.html
but the list is still on the left

[snip stylesheet]

If you want to center something by using left and right
margins, you should also define a width.
Either define width and set the margins to auto, or define
the margins and set the width to auto.

I think you are right about the need of defininge a the margins and set
the width to auto or viceversa but the code which I wrote below and I used
as 38.css ( trying to get a better effect) is unfortunately not for a list
which does not have css bullets and is written horizontally. What is wrong
with it?

I think this:
div.ulmenu {
display: inline;
list-style-type: none;

margin:auto;
padding: 0;

text-align:center;
width:50%

}
#navigation li {
display: inline;
list-style-type: none;
}
ul {
list-style:none;
margin:auto;


}

there is no div.ulmenu in the html file
just an div#navigation and a ul.menu.....
 
L

Luigi Donatello Asero

Els said:
Luigi Donatello Asero wrote:

"Paul Furman" <[email protected]> skrev i meddelandet

I used this style (38.css) at
http://www.scaiecat-spa-gigi.com/sv/test.html
but the list is still on the left

[snip stylesheet]

If you want to center something by using left and right
margins, you should also define a width.
Either define width and set the margins to auto, or define
the margins and set the width to auto.

I think you are right about the need of defininge a the margins and set
the width to auto or viceversa but the code which I wrote below and I used
as 38.css ( trying to get a better effect) is unfortunately not for a list
which does not have css bullets and is written horizontally. What is wrong
with it?

I think this:
div.ulmenu {
display: inline;
list-style-type: none;

margin:auto;
padding: 0;

text-align:center;
width:50%

}
#navigation li {
display: inline;
list-style-type: none;
}
ul {
list-style:none;
margin:auto;


}

there is no div.ulmenu in the html file
just an div#navigation and a ul.menu.....

I think I make some basic mistake when I try to define classes and id:s.
I tried to change the html code and use a div class which is called
"stadsdelar" and used a new css style (39.css) but it does not validate
http://jigsaw.w3.org/css-validator/validator?uri=http://www.scaiecat-spa-gigi.com/sv/test.html
and I wonder which one line 0 is!
 
E

Els

Luigi said:
I think I make some basic mistake when I try to define classes and id:s.
I tried to change the html code and use a div class which is called
"stadsdelar" and used a new css style (39.css) but it does not validate
http://jigsaw.w3.org/css-validator/validator?uri=http://www.scaiecat-spa-gigi.com/sv/test.html
and I wonder which one line 0 is!

is the previous problem solved yet?
This stylesheet 39.css doesn't validate, because of the }
between the styles for div.stadsdelar and ul, at the bottom
of the stylesheet.
 
L

Luigi Donatello Asero

Els said:
is the previous problem solved yet?
This stylesheet 39.css doesn't validate, because of the }
between the styles for div.stadsdelar and ul, at the bottom
of the stylesheet.

I had seen and corrected it but thanks anyway. What about the fact that
the list is still vertically aligned, though?
 
E

Els

Luigi said:
I had seen and corrected it but thanks anyway. What about the fact that
the list is still vertically aligned, though?

Change the last parts of your stylesheet to:

div.stadsdelar {
margin:auto;
padding:0;
text-align:center;
width:50%;
}

ul {
margin:auto;
list-style-type:none;
}

li {
display:inline;
}

Not the div.stadsdelar has to be displayed inline, but the
<li>'s.
Same goes for list-style-type, this apllies to the ul, not
to the div. You set it on both, but a div doesn't have a
list-style-type as far as I know.
 
L

Luigi Donatello Asero

Els said:
Change the last parts of your stylesheet to:

div.stadsdelar {
margin:auto;
padding:0;
text-align:center;
width:50%;
}

ul {
margin:auto;
list-style-type:none;
}

li {
display:inline;
}

Not the div.stadsdelar has to be displayed inline, but the
<li>'s.
Same goes for list-style-type, this apllies to the ul, not
to the div. You set it on both, but a div doesn't have a
list-style-type as far as I know.

Thank you.
Now it works
http://www.scaiecat-spa-gigi.com/sv/rom1.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Definition Lists 19
Image map in CSS. 1
Menu 10
Selectors 8
Table against list 2
Numbers in ordered lists 13
Name of the subsubdirectories. 10
Use of [ ] for button links. 5

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top