The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
A few days ago I decided I wanted to learn how to make websites. I have been reading tutorials online and looking at extremely overwhelming source pages so far.
Right now I'm just trying to make sense of all the commands. I've put together a simple web page. Here is the HTML:
It was going well until I added more paragraphs. I guess I don't fully understand the div command. I thought the box would expand as I added text, but obviously it doesn't. I'm not sure why. Any help, whether it pertain to this certain problem or problems in how I write the code, would be greatly appreciated.
MiserableMirth on
0
Posts
admanbunionize your workplaceSeattle, WARegistered Userregular
edited April 2009
I don't see anything particularly wrong with the code, except there's no reason to use tables for a list of links. What happens when you add more paragraphs?
I tried list earlier, but I couldn't get them to align with the left side of the box like I wanted. It seems like list automatically indent and they don't listen to align commands.
The paragraphs inside the .content section overlap and don't stay within it.
You can set lists to get rid of the indent, or you can just stick the links in paragraph tags instead of a table. I'm still working at getting divs to work right sometimes myself... but it might be that the small box div is around the content div?
And the content div will only be as wide as you set it... are the paragraphs overlapping down?
Your problem is your lack of doctype specification.
You should decide what doctype you're going to use and start learning to code with it because they each have their quirks. Without it a browser will default to "quirks mode" which basically means who the fuck knows how it will decide to render.
Slap the following at the very top of your .html file above the <html> tag:
This will fix your overflow issue. (Although it will also rain on your 100% height parade on your sidebars. Life is hard.)
Google doctype for more info.
edit.. also fyi you have some typos in your css. Get a decent editor (I use Scite) that will highlight text according to file context.
edit 2.. and if you're wondering about your new background issue, the general workaround is to make a width x 1px background image which you then assign as the background to the container that holds your columns.
FightTest on
MOBA DOTA.
0
Seguerof the VoidSydney, AustraliaRegistered Userregular
edited April 2009
Also h1 (hX where X is a number 1-6) are Headings, and should be used semantically as such (rather than a small sub-text..)
List items automatically assign a margin and a padding. Well, actually, pretty much every html element has some amount of padding and margin automatically assigned to it by the browser. This means that even if the css is turned off if you've marked your page up semantically correct it will still read nice. One thing I always do is set the margin / padding to 0 for every html element (ul, ul li, p, h1, h2, etc) so that when I come to place these in the page it's just a case of adding whatever margin and padding I want.
You have two lists of links, just use what's already there, save yourself some code and steer clear of contracting div-itis:
That'll make the left list sit at the left hand side of the page, have a 5px margin around it and have the text line up along with any border you give the list.
I know this doesn't help with your original problem but as a commercial web developer I fucking hate it when I see sites that have <div class=""> everywhere and use <span class="header">.
SporkAndrew on
The one about the fucking space hairdresser and the cowboy. He's got a tinfoil pal and a pedal bin
0
Seguerof the VoidSydney, AustraliaRegistered Userregular
List items automatically assign a margin and a padding. Well, actually, pretty much every html element has some amount of padding and margin automatically assigned to it by the browser. This means that even if the css is turned off if you've marked your page up semantically correct it will still read nice. One thing I always do is set the margin / padding to 0 for every html element (ul, ul li, p, h1, h2, etc) so that when I come to place these in the page it's just a case of adding whatever margin and padding I want.
You have two lists of links, just use what's already there, save yourself some code and steer clear of contracting div-itis:
That'll make the left list sit at the left hand side of the page, have a 5px margin around it and have the text line up along with any border you give the list.
I know this doesn't help with your original problem but as a commercial web developer I fucking hate it when I see sites that have <div class=""> everywhere and use <span class="header">.
Google css-reset, there are pretty comprehensive stylesheets to reset the attributes of different elements, and then in your own stylesheet you add only what you want/need.
Google css-reset, there are pretty comprehensive stylesheets to reset the attributes of different elements, and then in your own stylesheet you add only what you want/need.
Dang, that's great. Has a whole bunch of stuff that my standard import doesn't cover, thanks!
SporkAndrew on
The one about the fucking space hairdresser and the cowboy. He's got a tinfoil pal and a pedal bin
Your problem is your lack of doctype specification.
You should decide what doctype you're going to use and start learning to code with it because they each have their quirks. Without it a browser will default to "quirks mode" which basically means who the fuck knows how it will decide to render.
Slap the following at the very top of your .html file above the <html> tag:
This will fix your overflow issue. (Although it will also rain on your 100% height parade on your sidebars. Life is hard.)
Google doctype for more info.
edit.. also fyi you have some typos in your css. Get a decent editor (I use Scite) that will highlight text according to file context.
edit 2.. and if you're wondering about your new background issue, the general workaround is to make a width x 1px background image which you then assign as the background to the container that holds your columns.
I remember reading about DOCTYPEs but I must not been paying much attention because I thought it was simply information. I didn't know it had an impact on the page.
Yes, it seems setting height to 100% was the problem. I removed them all. I thought it would set the length of whatever element to the entire length of the div section it was placed but it just seems to do whatever.
As for an editor, I have also heard of wordpress. I think they are both free. Does anyone have experience with them both?
I think I got it like I originally wanted it now:
Right now I'm just trying to refine my skills at this. I was wondering if there were practice problems are something I could use? Like a problem where it gives you a written set of criteria of a webpage and then has a finished example so you can check your work maybe.
Thanks again for everyone's help! :]
MiserableMirth on
0
Seguerof the VoidSydney, AustraliaRegistered Userregular
edited April 2009
What do you mean by editor? Wordpress is a blog/half cms system that won't really help you learn how to "make" websites or teach you.
What you want is something that will give you syntax highlighting and/or code popups (I can never remember that this is called)
I use phpEd but it is a commerical program and is geared towards the more heavy duty developer, but I've heard others rave about Notepad++
Something that shows you mistakes in your syntax is what I meant by editor. I guess that isn't the correct term. I thought wordpress was something similar to those, but you're right about it catering more to blogs. I downloaded Scite but haven't given it a try yet.
As a heads-up with Scite if you start a new file it doesn't highlight anything until you save it as the appropriate file type. Also choosing Options/Global Options will allow you to change settings. I change tabsize and indent.size to 3 and use.tabs to 0. Also in the source.files I add *.css and *.php so they show up by default when you try to open a file.
Posts
The paragraphs inside the .content section overlap and don't stay within it.
And the content div will only be as wide as you set it... are the paragraphs overlapping down?
Some of those divs should be ids and not classes; it won't help your current problem but it's good to learn the difference.
You haven't closed the <h1> tag in your header - is that causing problems?
Do you have an image of how you want the webpage to look that you could show us?
You should decide what doctype you're going to use and start learning to code with it because they each have their quirks. Without it a browser will default to "quirks mode" which basically means who the fuck knows how it will decide to render.
Slap the following at the very top of your .html file above the <html> tag:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
This will fix your overflow issue. (Although it will also rain on your 100% height parade on your sidebars. Life is hard.)
Google doctype for more info.
edit.. also fyi you have some typos in your css. Get a decent editor (I use Scite) that will highlight text according to file context.
edit 2.. and if you're wondering about your new background issue, the general workaround is to make a width x 1px background image which you then assign as the background to the container that holds your columns.
1 ->
More important ->
In your example you could lose the classes on the tables. Then target them as follows
div.right table {
}
This will apply the same styles to all tables inside of the div class="right" parent element. This is useful for keeping your html mark up cleaner
You have two lists of links, just use what's already there, save yourself some code and steer clear of contracting div-itis:
[html]
<ul id="left-list">
<li><a href="" title="">blargh</a></li>
</ul>
[/html]
That'll make the left list sit at the left hand side of the page, have a 5px margin around it and have the text line up along with any border you give the list.
I know this doesn't help with your original problem but as a commercial web developer I fucking hate it when I see sites that have <div class=""> everywhere and use <span class="header">.
Google css-reset, there are pretty comprehensive stylesheets to reset the attributes of different elements, and then in your own stylesheet you add only what you want/need.
Dang, that's great. Has a whole bunch of stuff that my standard import doesn't cover, thanks!
I remember reading about DOCTYPEs but I must not been paying much attention because I thought it was simply information. I didn't know it had an impact on the page.
Yes, it seems setting height to 100% was the problem. I removed them all. I thought it would set the length of whatever element to the entire length of the div section it was placed but it just seems to do whatever.
As for an editor, I have also heard of wordpress. I think they are both free. Does anyone have experience with them both?
I think I got it like I originally wanted it now:
Right now I'm just trying to refine my skills at this. I was wondering if there were practice problems are something I could use? Like a problem where it gives you a written set of criteria of a webpage and then has a finished example so you can check your work maybe.
Thanks again for everyone's help! :]
What you want is something that will give you syntax highlighting and/or code popups (I can never remember that this is called)
I use phpEd but it is a commerical program and is geared towards the more heavy duty developer, but I've heard others rave about Notepad++