Below is my code which I am having 2 problems with, hope you can help me out.
1. Strange, but if I put the #tral tag begin the .section, the <div id="tral"> doesn't seem to work, if I switch him in order with the footer for example, then the footer doesn't work.
2. Suppose if I switch him with the footer, then I see the image, but it is a transparant image. I tried to get the opacity to 1.0 but it doesn't seem to work out...
Are you confusing HTML with XML? Because in HTML there are predefined elements, you can’t create your own as in XML. And in HTML (even in XHTML) there are no elements called <logo>, <box>, <concepts>. And the <header> element was just introduced in HTML version 5 which you don’t seem to be using, though, seeing that you don’t use <section> and <footer> when you could (if you were writing HTML 5, not 4).
Are you confusing HTML with XML? Because in HTML there are predefined elements, you can’t create your own as in XML. And in HTML (even in XHTML) there are no elements called <logo>, <box>, <concepts>. And the <header> element was just introduced in HTML version 5 which you don’t seem to be using, though, seeing that you don’t use <section> and <footer> when you could (if you were writing HTML 5, not 4).
I am not really sure . Are you suggesting that I should use <div id="logo"> etc instead of <logo>? I guess I mixed em up?
(excuse me, recently just started css-ing)
Yes, you should use divisions with IDs or classes. It could very well be that the invalid elements cause the browser to ignore everything within them, too. Valid HTML is always making things easier – as well as valid CSS. Also, make sure that the file path is correct. It must always be relative to the stylesheet. In your case the stylesheet is in the HTML file so the CSS is looking for it in the same directory where the HTML file resides.
And did you post your entire HTML code here? Because if you did then you are missing the obligatory first line, the doctype declaration. I’d recommend the following one:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
And then remove the following from your HTML element:
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
Edit:By the way: Here is a list of all valid HTML elements.
Yes, you should use divisions with IDs or classes. It could very well be that the invalid elements cause the browser to ignore everything within them, too. Valid HTML is always making things easier – as well as valid CSS. Also, make sure that the file path is correct. It must always be relative to the stylesheet. In your case the stylesheet is in the HTML file so the CSS is looking for it in the same directory where the HTML file resides.
And did you post your entire HTML code here? Because if you did then you are missing the obligatory first line, the doctype declaration. I’d recommend the following one:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
And then remove the following from your HTML element:
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
Edit:By the way: Here is a list of all valid HTML elements.
I don't think they are ignored since the "Grid" and "col" are doing just fine... Anyway, let me start with that validator, and try to clean it up, afterwards I will come back here to see wheter the problemo is solved or not, thank you for now!
Yes, you should use divisions with IDs or classes. It could very well be that the invalid elements cause the browser to ignore everything within them, too. Valid HTML is always making things easier – as well as valid CSS. Also, make sure that the file path is correct. It must always be relative to the stylesheet. In your case the stylesheet is in the HTML file so the CSS is looking for it in the same directory where the HTML file resides.
And did you post your entire HTML code here? Because if you did then you are missing the obligatory first line, the doctype declaration. I’d recommend the following one:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
And then remove the following from your HTML element:
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
Edit:By the way: Here is a list of all valid HTML elements.
I am actually still having the same problem, the div id="tral" doesn't seem to get displayed...
In the CSS part, if i switch it in order with "footer" the footer seems not to get displayed, but the tral does.. (however, transparant, it shouldn't be transparant..)
Oh I see, this one was hard to spot. It seemed to be caused by the .section rule before #tral; whatever comes after doesn’t get any CSS applied. The CSS looks correct and then I decided to run it through the CSS validator and got this error:
Quote:
Lexical error at line 165, column 2. Encountered: "?" (63), after : "" }??? #tral{ opacity:1.0; filter:alpha(opacity=100); /* For IE8 and earlier */ background-image: url('box_1.png'); width: 750px; height: 133px; float: left; background-color: transparent; background-repeat: no-repeat; background-position: top; }
This tells us that there is a (hidden) character after the closing bracket of the .section {…} rule, and indeed, if I place my cursor behind the rule and hit backspace it’s not deleting the bracket but obviously the hidden character. That should fix it.
And by the way: Opacity is alway inherited, you can’t have children that are more opaque than their parent. In short: 100% of 50% opacity is still 50% opacity.
this hidden characters turn out to be a combination of 3 characters, URI encoded to:
%E2%80%8B
%E2 = a circumflex
%80= padding character (C1 control code)
%88= Partial Line Forward/Partial Line Down (C1 control code), which according to http://en.wikipedia.org/wiki/C0_and_C1_control_codes is used by printers for superscript and subscript.