Hi I have the folowing problem:

The css wont apply to html although everything is corectly

<link href="../../../../default.css" rel="stylesheet" type="text/css" media="all" />

...

<h4><?php echo $gamename[2]; ?></h4>

and in the css i have the following

h4 {
    color: #FFF;
    font-size: large;
    font-family: "Courier New", Courier, monospace;
}

Recommended Answers

All 20 Replies

Do you have this online somewhere to view? My guess is that the path to the CSS is incorrect.

I don't even see the h4 in your CSS file. Are you sure you uploaded a new version?

Member Avatar for stbuchok

Your page doesn't even have an h4 tag, so how do you know it's not working, not to mention what pritaes said?

sorry i'm working on a local server i update right now

My server is down for the moment i will update as soon is back online

if the file is at the document root, or a subfolder of the root, it is often more convenient to reference the root, the path is a constant regardless of the depth of the folder structure the site attains
<link href="/default.css" rel="stylesheet" type="text/css" media="all" />
<link href="/css/default.css" rel="stylesheet" type="text/css" media="all" />

Use firebug or inspect element, it will make your life easier

The css is at the root of the document is working properly for Div's and background but not for p and h4

@charset "utf-8";
/* CSS Document */

body {
    background-image:url(images/background.jpg);
    background-color:#000;
    background-repeat:no-repeat;
    background-position:top left;
}

try body { backround:url(images/background.jpg) #000 no-repeat top left; }
small is beautiful

cant see a definition of h4 or p in the css,

try to get away from px as dimensions, they dont work,
on anything except the screen you laid it out on.
em or % are current best practice, scalars that auto adjust to almost every device, fixed width elements push offscreen in partscreen windows or small devices, users usually wont scroll right, mice dont have hscroll wheels

Now is working and i updated the css still the problem persists

Member Avatar for stbuchok

Again, there is no H4 tag on the page, therefore your CSS will not apply to anything.

There is a

<h4></h4>

Right under

<div id="content">
Member Avatar for stbuchok

ok so I just realized that the url you gave is not the url the problem is on, apparently you have to navigate to it. Next time, just put the url of the actual issue.

http://www.jocurigratisonlinenet.ro/jocuri/actiune

Also, there is no <H4 tag anywhere on the page, no where, notta. If you view source, there is not a single <h4 tag.

This is what I see for the <div id="content"> div:

<div id="content">
<table><tr><td align="center"><a href="jocuri/Ghosts_Vs_Zombies" style="text-decoration:none"><img src="jocuri/Ghosts_Vs_Zombies/image.php" style="display:block" />Ghosts Vs Zombies</a></td><td align="center"><a href="jocuri/Ninja_vs_Zombie" style="text-decoration:none"><img src="jocuri/Ninja_vs_Zombie/image.php" style="display:block" />Ninja vs Zombie</a></td><td align="center"><a href="jocuri/Boom_Zombie" style="text-decoration:none"><img src="jocuri/Boom_Zombie/image.php" style="display:block" />Boom Zombie</a></td><td align="center"><a href="jocuri/Trojan_Hero" style="text-decoration:none"><img src="jocuri/Trojan_Hero/image.php" style="display:block" />Trojan Hero</a></td><td align="center"><a href="jocuri/Cake_Cafe" style="text-decoration:none"><img src="jocuri/Cake_Cafe/image.php" style="display:block" />Cake Cafe</a></td></table><br>
    </div>

So either you haven't updated the proper files or you have PHP that causes it not to render. At any case it's not on the page, plese just view source and you will see.

Select a game from there and acces it there you'll see the tag

Member Avatar for stbuchok

http://www.jocurigratisonlinenet.ro/default.css does not contain a definition for h4. Also, like it's been suggested, use absolute paths instead of relative, easier to read and understand rather than a relative link four levels deep.

It does now, and how should i use the links?

I changed the link to absolute path but still doesnt work. What else could i do?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.