quick css question
- Started
- Last post
- 7 Responses
- jysta0
*FFS, I mean the left column with text-align right...
- neverblink0
<li> <span class="characteristic"> Eye Colour: </span> Brown </li>
<li> <span class="characteristic"> Hair Colour: </span> Light Brown </li>.characteristic{
display: block;
float: left;
width: 100px;
text-align: right;
}- Ah, cheerz mate, I was just missing the float left! :-)jysta
- doesn't really need the display:block bit.. setting float will set it automaticlyneverblink
- JamesBoynton0
Well, you can text align right when not using tables, but arent tables meant for this sort of thing? i very very rarely use tables but for this i would i think.
- neverblink0
James, yes you would be right in saying that tables would be perfect for this (tables for tabular data) - but this is just a list, disabling css doesn't destroy the layout and it doesn't require more html/tags to declare..
- Definition lists FTW! :)Stugoo
- keep it lean ;-ojysta
- Anyone else find CSS therapeutic?jysta
- Yeah, saw your post after i poster mine, good points... need to find my basic css book again. GahJamesBoynton
- i fucking jizz at css. jQuery is like sex toysStugoo
- Stugoo0
yes I would use a definitition list
<dl>
<dt>eye colour</dt>
<dd>Brown</dd><dt>Children</dt>
<dd>0</dt>
....
</dl>then do
dl { width: 500px; float:left;}
dt{width: 245px; padding-right:5px; float:left; text-align:right; }
dd{width:250px; float:left; text-align:left;}- yeah good point Stu, will change my markup as this is more specific and will be integrated into a dating site back-end/jysta
- neverblink0
I don't know why, but I've never really used definition lists (never had the need to, and as I can see bring no real advantage over normal lists).. although they seem to be "made" for this kind of data..
- Stugoo0
i was the same for ages, i like them but they can get a bit annoying.