Welcome, Guest. Please login or register.

Author Topic: simple css/html issue anyone want to look at it?  (Read 3559 times)

0 Members and 1 Guest are viewing this topic.

Offline Blackllama

simple css/html issue anyone want to look at it?
« on: July 05, 2011, 11:03:49 PM »
Okay so I've been fooling around with css and html and I've noticed an issue.

Here's my html file:
Code: [Select]
<html>
<head>
<link rel="stylesheet" type="text/css" href="file:///C:/Users/Max/Desktop/style.css" />
<h1>This webpage is useless, I'm using to test external css styles.</h1>
<title>Test Page</title>
</head>
<body>
This is some sample body text.
</body>
</html>

And my css file:
Code: [Select]
<style type="text/css" />

body {background-color:#b0c4de;}
h1 {color:#0c8316;}
</style>

Basically here's the problem, the background color doesn't change when I view the webpage.  The text on the header does though.  I don't see any typos or anything like that, and I'm viewing in in google chrome.  Anyone know why this might not be working?

I know it'd probably have been a better idea posting this on some coding forum but I'll let CG take a shot at it first.

Maurice Moss

  • Guest
Re: simple css/html issue anyone want to look at it?
« Reply #1 on: July 06, 2011, 02:24:55 AM »
Just delete the <style> tag in the style.css file, as the <style> tag is only used in the .html file, and then under a <head> tag, and then it will work perfect again.

Code: [Select]
body{
    background-color: #b0c4de;
}
h1{
    color:#0c8316;
}

You can use that OR this

Code: [Select]
body {background-color:#b0c4de;}
h1 {color:#0c8316;}

Conjoint Gaming [Game On]

Re: simple css/html issue anyone want to look at it?
« Reply #1 on: July 06, 2011, 02:24:55 AM »

Offline Blackllama

Re: simple css/html issue anyone want to look at it?
« Reply #2 on: July 06, 2011, 03:03:44 AM »
Ahh, I didn't realize you don't need the style in the css file...

EDIT:
I modified them and it still doesn't work...

CSS:
Code: [Select]
body {background-color:##CAFB4E;}
h1 {color:#0c8316;}

HTML:
Code: [Select]
<link rel="stylesheet" type="text/css" href="file:///C:/Users/Max/Desktop/style.css" />
<h1>This webpage is useless, I'm using to test external css styles.</h1>
<title>Test Page</title>
<body>
This is some sample body text.
</body>

It still doesn't work...
« Last Edit: July 06, 2011, 03:14:37 AM by Blackllama »

Maurice Moss

  • Guest
Re: simple css/html issue anyone want to look at it?
« Reply #3 on: July 06, 2011, 04:55:24 AM »
I didn't mean you should remove the <html></html> and <head></head> tags XD

Also, it still works for me, except that you had 2 '##' in the body background thingy

Code: [Select]
body {background-color:##CAFB4E;}

change to

body {background-color:#CAFB4E;}

Otherwise it works perfectly fine for me http://zhost.tk/u/tg/test.jpg

HTML file should look like this
Code: [Select]
<html>
<head>
<link rel="stylesheet" type="text/css" href="test.css" />
<h1>This webpage is useless, I'm using to test external css styles.</h1>
<title>Test Page</title>
</head>
<body>
This is some sample body text.
</body>
</html>
« Last Edit: July 06, 2011, 04:58:23 AM by Maurice Moss »

Offline Blackllama

Re: simple css/html issue anyone want to look at it?
« Reply #4 on: July 06, 2011, 05:24:16 AM »
I didn't mean you should remove the <html></html> and <head></head> tags XD

Also, it still works for me, except that you had 2 '##' in the body background thingy

Code: [Select]
body {background-color:##CAFB4E;}

change to

body {background-color:#CAFB4E;}

Otherwise it works perfectly fine for me http://zhost.tk/u/tg/test.jpg

HTML file should look like this
Code: [Select]
<html>
<head>
<link rel="stylesheet" type="text/css" href="test.css" />
<h1>This webpage is useless, I'm using to test external css styles.</h1>
<title>Test Page</title>
</head>
<body>
This is some sample body text.
</body>
</html>

Yah, I removed those tags to see if it would still work the same, and it did, I'm not sure how necessary the html tag is if it's a html file but whatever.

And as for the ##:
Fucking typos...  Anyway it works now, thanks.

Maurice Moss

  • Guest
Re: simple css/html issue anyone want to look at it?
« Reply #5 on: July 06, 2011, 08:47:04 AM »
Yah, I removed those tags to see if it would still work the same, and it did, I'm not sure how necessary the html tag is if it's a html file but whatever.

Well, most browsers can still read the html file if you do not add the html/head/body tag, but it's still best to use them.

Conjoint Gaming [Game On]

Re: simple css/html issue anyone want to look at it?
« Reply #5 on: July 06, 2011, 08:47:04 AM »

 


* ShoutBox!

Refresh History
  • Careful what you post. Forum rules still apply in the shoutbox!
  • Pyro: happy birthday Tyber
    July 14, 2024, 01:55:16 PM
  • Finniespin: More of a Patrick Hernandez guy - Born to be Alive
    June 16, 2024, 09:14:27 AM
  • Sly: Aaron Hernandez was a legend of a man
    June 14, 2024, 01:46:02 AM
  • Finniespin: how? what?
    June 01, 2024, 06:28:43 PM
  • Inject OH 4: Lost my discord rip
    May 30, 2024, 12:14:57 AM
  • Finniespin: yoooooooo!
    April 03, 2024, 05:32:48 PM
  • Coreybush11: bump
    April 01, 2024, 10:59:48 PM
  • Finniespin: wut
    March 28, 2024, 05:01:26 PM
  • Inject OH 4: And yes thank you very much Finnie! You are a champion xP
    March 22, 2024, 05:59:12 PM
  • Inject OH 4: Hey abrys agreed we should.
    March 22, 2024, 05:59:02 PM
  • Finniespin: Totally not a spam-bot, also totally not a limited time offer
    March 03, 2024, 05:25:06 PM
  • Finniespin: Anyone looking for a datacenter technician job? We got postings available around US and Europe (EMEA)
    February 17, 2024, 07:23:12 AM
  • Finniespin: https://www.google.com/about/careers/applications/jobs/results/118336179041903302-data-center-technician-global-server-operations
    February 17, 2024, 07:20:25 AM
  • Finniespin: Gave Inject 50 euros to pay for fees ^^
    February 17, 2024, 07:17:42 AM
  • xXArbysOvenMittXx: we gotta get the crew together again one day and hang, add me on discord: ogarbies
    February 12, 2024, 06:52:07 PM
  • xXArbysOvenMittXx: yo who is still paying for this lol
    February 12, 2024, 06:19:47 PM
  • Klondor: wow CG still lives, mind blown
    February 09, 2024, 05:13:53 AM
  • Finniespin: The website is back online!!!
    February 06, 2024, 03:17:05 PM
  • Inject OH 4: xD
    January 14, 2024, 05:55:44 PM
  • Finniespin: Get a load of this guy
    December 16, 2023, 09:16:03 AM
  • Inject OH 4: Sure
    December 09, 2023, 07:22:27 PM
  • HailToTheKing: cum shot . and cum shot. an d cum shot
    December 01, 2023, 01:54:12 PM
  • Finniespin: ffuck
    November 24, 2023, 03:43:47 PM
  • Inject OH 4: ee
    October 12, 2023, 01:13:56 AM
  • Sly: dd
    August 09, 2023, 03:13:48 AM
  • Inject OH 4: cc
    August 03, 2023, 09:51:36 PM
  • Finniespin: bb
    August 02, 2023, 06:12:50 PM
  • Inject OH 4: aa
    July 04, 2023, 10:29:35 PM
  • Shikaru: Been a very long time
    February 20, 2023, 05:42:04 PM
  • Shikaru: Oh wow my account is STILL active :)
    February 20, 2023, 05:42:00 PM
  • Napoleon BonaPARTY: yooo we got a lovense sponsor???
    December 16, 2022, 03:45:43 PM
  • Napoleon BonaPARTY: holy shit
    December 16, 2022, 03:45:24 PM
  • Napoleon BonaPARTY: oh wow its still here
    December 16, 2022, 03:45:21 PM
  • HailToTheKing: legends never die
    October 16, 2022, 01:28:09 PM
  • Live Bait: Oh wow. Still remember my old password.
    September 23, 2022, 08:37:38 AM
  • Mr_Rainbow: Still alive. Hope all is well with everyone this Christmas
    December 09, 2021, 03:31:04 AM
  • SlyWilliam: Much love, from our MC server to our ZPS server <3
    December 07, 2021, 10:23:37 PM
  • SlyWilliam: For the record, I don't REALLY remember all of you, but goddamn do I MISS all of you <3
    December 07, 2021, 10:23:10 PM
  • Pyro: parrot
    September 07, 2021, 05:23:18 AM
  • Inject OH 4: Do you mean for people that haven't come on in a long time and have to reagree?
    August 02, 2021, 11:39:42 PM

SimplePortal 2.3.5 © 2008-2012, SimplePortal