Be a Supporter!

Solid Block Of Colour

  • 789 Views
  • 8 Replies
New Topic Respond to this Topic
luke-stealth-man
luke-stealth-man
  • Member since: Jul. 8, 2005
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Solid Block Of Colour 2006-11-05 15:27:56 Reply

Say i want to make a solid block of a certain colour and put some text in it.
I could use an image, but id rather use HTML or something.
I dont want to use a full table or anything as complicated as that... Just a simple line of code or something if possible.

Ive atached a picture showing what i mean ^^

Solid Block Of Colour

elbekko
elbekko
  • Member since: Jul. 23, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Solid Block Of Colour 2006-11-05 15:32:48 Reply

<span style="height: 35px; width: 200px; background-color: #FF0000">Text goes here</span>

That should do it. Change the dimensions and colour to whatever you want ;)


"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature
Jcrypt
Jcrypt
  • Member since: Aug. 23, 2005
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Solid Block Of Colour 2006-11-05 15:33:21 Reply

use a div layer... Example:

<div id="main" style="background-color: #FF0000; z-index: 2; position: absolute; left: 300 px; top: 50px"> My text here!!!!!!!!!!!!!</div>

DoomyCheese
DoomyCheese
  • Member since: Aug. 25, 2006
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to Solid Block Of Colour 2006-11-06 02:03:16 Reply

I just use dreamweaver or Microsoft Frontpage, I set it up how I want it, then go across to the code for it, then cut and paste it. :P


BBS Signature
Jessii
Jessii
  • Member since: Feb. 10, 2005
  • Offline.
Forum Stats
Member
Level 36
Movie Buff
Response to Solid Block Of Colour 2006-11-06 08:46:39 Reply

At 11/6/06 02:03 AM, DoomyCheese wrote: I just use dreamweaver or Microsoft Frontpage, I set it up how I want it, then go across to the code for it, then cut and paste it. :P

And how does this help this guy's particular problem?

I say that if you know how to use tables, you can use a table cell, put the text in the table and then change the background color:

<div id="main" style="background-color: #FF0000; z-index: 2; position: absolute; left: 300 px; top: 50px"> My text here!!!!!!!!!!!!!</div>

That's the OLD way of doing it. Now everything should be done in css, it makes it a lot easier to change the style of the div but since he asked for HTML this would work.

But if you were to use css, it would look like this:

#main {z-index: 1;
position: absolute;
background-color: #FF0000;
left: 300px;
top: 0px; }

To learn more about it, go to http://www.w3schools.com

elbekko
elbekko
  • Member since: Jul. 23, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Solid Block Of Colour 2006-11-06 09:58:36 Reply

At 11/6/06 08:46 AM, Jessii wrote:
<div id="main" style="background-color: #FF0000; z-index: 2; position: absolute; left: 300 px; top: 50px"> My text here!!!!!!!!!!!!!</div>
That's the OLD way of doing it. Now everything should be done in css, it makes it a lot easier to change the style of the div but since he asked for HTML this would work.

Err... everything in the style attribute is CSS :P It's inline styling and recommended by W3C for this stuff.


"My software never has bugs. It just develops random features. " - Unknown

[ FluxBB developer | Quickmarks 0.5.1 | Strings & Ints - my blog ]

BBS Signature
wolfinator-x
wolfinator-x
  • Member since: Jul. 17, 2006
  • Offline.
Forum Stats
Member
Level 13
Musician
Response to Solid Block Of Colour 2006-11-06 10:08:15 Reply

I would help you... if I knew what you mean...


BBS Signature
Zendra
Zendra
  • Member since: Sep. 7, 2003
  • Offline.
Forum Stats
Member
Level 51
Blank Slate
Response to Solid Block Of Colour 2006-11-06 10:25:44 Reply

At 11/6/06 10:08 AM, wolfinator-x wrote: I would help you... if I knew what you mean...

How about you first check the previous posted replies and than see if you still need to help.

smulse
smulse
  • Member since: Mar. 24, 2005
  • Offline.
Forum Stats
Member
Level 31
Blank Slate
Response to Solid Block Of Colour 2006-11-06 15:38:57 Reply

As above or you could use a prargraph background colour for the text using CSS rather than span.


BBS Signature