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.



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

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
display:block

how come my display:block only makes the table dimesion around the FIRST <a> tag part of the hyperlink?

  #2 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
come on guys i rely on u lol :wink:
  #3 (permalink)  
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?
  #4 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
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?
  #5 (permalink)  
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
  #6 (permalink)  
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.
  #7 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
the css is is purely

a {

display:block;

}
  #8 (permalink)  
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...
  #9 (permalink)  
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]
  #10 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
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...
  #11 (permalink)  
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...
  #12 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
thanks but it still wouldn't look the same as if it was in a <td> though would it? sorry lol
  #13 (permalink)  
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]
  #14 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
thanks i'd forgotton about the wonderful awesome power that is CSS!
  #15 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
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?
  #16 (permalink)  
Old Jul 4th, 2004, 12:15
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,951
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Why the tables? The whole point of XHTML and CSS is to lose code bloat (ie... tables)
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #17 (permalink)  
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
Send a message via MSN to benbacardi Send a message via Skype™ to benbacardi
the tables because i cant get

or <ul>[*] to go next to each other.. they go under each other instead
  #18 (permalink)  
Old Jul 5th, 2004, 08:54
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,951
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
you need this:-
display:inline;

on any block elements you want to be treated as inline elements... eg:- p tags, and li tags.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #19 (permalink)  
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
Send a message via MSN to capture Send a message via Yahoo to capture
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
  #20 (permalink)  
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
Send a message via MSN to capture Send a message via Yahoo to capture
Sorry, didn't see the PLEASE REMEMBER message. Will not do that again.

capture
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overriding display:inline-block gazzou Web Page Design 0 Aug 27th, 2007 12:03
Display:Block in IE sparadox Web Page Design 4 Jul 25th, 2007 19:30
Help With Display: Block Vertical Spacing Please uqwebdesign Web Page Design 6 Jun 13th, 2006 16:07
New Man on the Block phillyphreak Introduce Yourself 6 Jul 1st, 2005 16:55
display:block benbacardi Web Page Design 4 Apr 21st, 2004 19:40


All times are GMT. The time now is 02:15.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43