display:block

This is a discussion on "display:block" within the Web Page Design section. This forum, and the thread "display:block are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Jun 15th, 2004, 17:23
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
display:block

how come my display:block only makes the table dimesion around the FIRST <a> tag part of the hyperlink?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Jun 17th, 2004, 10:26
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
come on guys i rely on u lol :wink:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Jun 17th, 2004, 13:23
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
I've no idea what you mean - can you be more descriptive or provide a demo?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Jun 17th, 2004, 13:35
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
ok...

for example: code:

<table>
<tr>
<td>
Text
</td>
</tr>
<tr>
<td>
Text
</td>
</tr>
<tr>
<td>
Text
</td>
</tr>
<tr>
<td>
Text
</td>
</tr>
</table>

only the first <a> fills the whole table cell, the others only apply the hyperlink to the text.. do you know what i mean now?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old Jun 17th, 2004, 17:21
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
uh.. where's the rest of the code? That's HTML and that won't do anything except put a link on the Text. Has to be some CSS I am not seeing
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Jun 17th, 2004, 19:14
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Assuming its nothing horribly simple I'd suggest it was a conflit with the table elements as sometimes CSS is not applied to elements within table. Show the CSS too.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
Old Jun 17th, 2004, 20:09
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
the css is is purely

a {

display:block;

}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Jun 17th, 2004, 20:20
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
its an IE bug... as to how to fix it...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
Old Jun 17th, 2004, 20:22
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
do it properly with a <UL>:

<ul>[*]Text[*]Text[*]Text[*]Text[/list]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Jun 18th, 2004, 10:41
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
but i need them in <td> because the <td> themselves have a rollover, so they cell changes colour... i suppose i could always add a onclick="location='index.html'" to the <td> but apart from that...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Jun 18th, 2004, 19:11
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
use a:hover to effect the rollover state...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Jun 19th, 2004, 13:31
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
thanks but it still wouldn't look the same as if it was in a <td> though would it? sorry lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #13  
Old Jun 19th, 2004, 14:59
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
try this:
Code: Select all
<style type="text/css">
ul { list-style-type: none; margin:0; padding:0; }
li { height:20px; width:100px border:1px solid gray;}
a { display: block; width:100%; }
a:hover {background: #fc0 }
</style>

<ul>[*]Text[*]Text[*]Text[*]Text[/list]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #14  
Old Jun 19th, 2004, 21:04
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
thanks i'd forgotton about the wonderful awesome power that is CSS!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #15  
Old Jul 4th, 2004, 10:58
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
ok this is the code I have for the menu:

Code: Select all
<table cellspacing="0" cellpadding="0">

<tr>

<td height="20" align="center" class="open">

<p class="menu">Menu One</p>

</td>

<td height="20" align="center" class="gap">
<p class="fill">-</p>
</td>

<td height="20" align="center" class="closed">

<p class="menu">Menu Two</p>

</td>

<td height="20" align="center" class="gap">
<p class="fill">-</p>
</td>

<td height="20" align="center" class="closed">

<p class="menu">Menu Three</p>

</td>

<td height="20" align="center" class="gap">
<p class="fill">-</p>
</td>

<td height="20" align="center" class="closed">

<p class="menu">Menu Four</p>

</td>

<td height="20" align="center" class="gap">
<p class="fill">-</p>
</td>

<td height="20" align="center" class="closed">

<p class="menu">Menu Five</p>

</td>

</tr>

<tr>

<td colspan="9" class="main" valign="top">

<p style="color:#997788">-</p>

</td>

</tr>

</table>
and this is the css:

Code: Select all
body {

font-family:verdana;
font-size:10pt;

}

.fill {

font-size:0pt;
color:#ffffff;

}

.open {

background-color:#997788;
border-left-style:solid;
border-top-style:solid;
border-right-style:solid;
border-color:#000099;
border-width:1px;
width:100px;
color:#ffffff;

}

.gap {

border-bottom-style:solid;
border-color:#000099;
border-width:1px;
width:10px;

}

.closed {

background-color:#997788;
border-bottom-style:solid;
border-color:#000099;
border-width:1px;
width:100px;
color:#ffffff;

}

.main {

background-color:#997788;
border-bottom-style:solid;
border-left-style:solid;
border-right-style:solid;
border-width:1px;
border-color:#000099;
height:100px;

}

a {

color:#ffffff;
text-decoration:none;
display:block;
width:100%;

}

a:hover {

background-color:#446622;

}

p.menu {

margin:0px;
padding:0px;
text-align:center;
height:100%;
width:100%;

}
The links now aren't vertically aligned within the <td>, and not all of the <td> changes color when you mouseover the links. Does anyone know why?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #16  
Old Jul 4th, 2004, 12:15
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,189
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
Why the tables? The whole point of XHTML and CSS is to lose code bloat (ie... tables)
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #17  
Old Jul 4th, 2004, 14:57
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
the tables because i cant get

or <ul>[*] to go next to each other.. they go under each other instead
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #18  
Old Jul 5th, 2004, 08:54
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,189
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
you need this:-
display:inline;

on any block elements you want to be treated as inline elements... eg:- p tags, and li tags.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #19  
Old Jul 21st, 2004, 21:49
New Member
Join Date: Jul 2004
Location: Olympic Penninsula WA
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Hi I am fairly new to CSS, but I do not use any table tags at all.

Here is code for a navigation bar positioned to the left of the main content.

CSS:

#left
{position:absolute;
left:0;
top:0;
height:100%;
width:200px;
background:#aaa;
background-position:0 100px;
font-size:1em;
color:#fff;
z-index:4;}

.pad2
{display:block;
height:100px;}

a.nav, a.nav:visited
{display:block;
width:100px;
height:25px;
text-decoration:none;
color:#fff;
font-weight:bold;
line-height:25px;}

a.nav:hover
{color:#fc0;}

HTML:

<div id="left">
<div class="pad2"></div>
<ul>[*]Home[*]About Me[*]Stuff[*]More Stuff[*]A whole lotta stuff[*]I'm finished[/list]</div>

Hash marks in place of url to make is easier to read.

My first post.
Thanks
capture
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #20  
Old Jul 21st, 2004, 21:53
New Member
Join Date: Jul 2004
Location: Olympic Penninsula WA
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry, didn't see the PLEASE REMEMBER message. Will not do that again.

capture
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
displayblock

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On