Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
My CSS-text-codes don't work in the html
Old 04-20-2009, 01:23 AM My CSS-text-codes don't work in the html
Junior Talker

Posts: 4
Name: Louise
Trades: 0
Hi All

I am a complete newbie to CSS and html (at least when you compare me to the rest of the website programming world), so please bear with me.

After hours of trying, I finally figured out how to make some boxes in css and it works well.
But the text-tags I've made in css don't "respond" when inserted in the html-code. The text shows, but it's the "standard", and not what I wrote in the CSS code.

I've looked at help sites and tried to copy their examples, but couldn't even then figure it out.

My header looks like this in html:
<head>

<div id="header">
<h1 id=htxt>This doesn't work!</h1> (tried lots of variations here)
</div>


</head>

CSS:

#header
{
color: #34DDDD;
width: 900px;
float: left;
padding: 10px;
Border: 9px solid #085dad;
height: 100px;
margin: 10px;
background-color: white;
}

#htxt
{
font-family: arial;
font-style: normal;
font-size: 2;
font-color: #FFFFFF;
}


I'm sorry if I'm not allowed to post code, please remove if not allowed.

Can anyone please help me?

Wishing you all a nice day

*Louise
Trixztar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-20-2009, 02:43 AM Re: My CSS-text-codes don't work in the html
Average Talker

Posts: 17
Name: Bryan Warner
Location: Idaho
Trades: 0
<h1 id=htxt>This doesn't work!</h1> (tried lots of variations here)

You need " " around your id=htxt. <h1 id="htxt"> and why are you putting content in you <head> section. It probably should be inbetween the <body> </body>. Thats all that i can see wrong with it. Hope this helps.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Great free web hosting
Please login or register to view this content. Registration is FREE

Make a good $500 to start
Please login or register to view this content. Registration is FREE
Warner Design is offline
Reply With Quote
View Public Profile
 
Old 04-20-2009, 03:14 AM Re: My CSS-text-codes don't work in the html
Junior Talker

Posts: 4
Name: Louise
Trades: 0
Thank s for the advice

I figured it out now.

But why shouldn't I put text in header? I put it in there as some kind of headline/"site-name-banner" on the top of my website... or maybe that is not the point in the header?

Sorry if that is a stupid question.

Take care,
*Louise
Trixztar is offline
Reply With Quote
View Public Profile
 
Old 04-20-2009, 06:10 PM Re: My CSS-text-codes don't work in the html
Average Talker

Posts: 17
Name: Bryan Warner
Location: Idaho
Trades: 0
There are no stupid questions here.

This is a quote for http://www.w3schools.com <-- (They are the leader for web standards and tutorials if you have not found them yet.)

"The elements inside the head element should not be displayed by a browser.

According to the HTML standard, only a few tags are legal inside the head section. These are: <base>, <link>, <meta>, <title>, <style>, and <script>."

Basically what it is saying is that anything in between <head> </head> are more for information for how the browser should act. Any content that you want displayed should be In the <body> </body> section.

The link to that page is http://www.w3schools.com/html/html_head.asp , for some more info on it.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

Great free web hosting
Please login or register to view this content. Registration is FREE

Make a good $500 to start
Please login or register to view this content. Registration is FREE

Last edited by Warner Design; 04-20-2009 at 06:13 PM..
Warner Design is offline
Reply With Quote
View Public Profile
 
Old 04-21-2009, 04:24 AM Re: My CSS-text-codes don't work in the html
Junior Talker

Posts: 4
Name: Louise
Trades: 0
Thank you so very much

I was wondering...

"Basically what it is saying is that anything in between <head> </head> are more for information for how the browser should act. Any content that you want displayed should be In the <body> </body> section".

-Does this mean that I can fit my website to both Firefox and IE with a tag placed in the <head>?

Encountered a big problem with these 2 browsers, right now I made it to fit into Firefox but it looks like *censored* in IE.
I think there are some threads about that. I'll go look for them ASAP

Wishing you a nice day!

*Louise
Trixztar is offline
Reply With Quote
View Public Profile
 
Old 04-21-2009, 02:34 PM Re: My CSS-text-codes don't work in the html
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
<head>

<div id="header">
<h1 id=htxt>This doesn't work!</h1> (tried lots of variations here)
</div>


</head>
The problem is that the <div id="header"> code does NOT BELONG in the document <head> section ! Move it after the <body> tag where it belongs and it should work.

Quote:
Does this mean that I can fit my website to both Firefox and IE with a tag placed in the <head>?
No, it doesn't. ALL the code for the layout of your site has to go into the <body> section of the html.

Unfortunately, IE6 (and to some degree 7) has some major bugs you need to learn to cope with - I suggest you start reading here: www.positioniseverything.net.

One bug you've triggered - the doubled-float margin bug by allowing a right margin on a right-floated div, IE6 and below will double that!
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 04-22-2009, 11:59 PM Re: My CSS-text-codes don't work in the html
Junior Talker

Posts: 4
Name: Louise
Trades: 0
Thank you very much for your advice, and the link

I hope I can make it work now.

Wishing you a nice day

*Louise
Trixztar is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to My CSS-text-codes don't work in the html
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.40863 seconds with 12 queries