PDA

View Full Version : HTML questions


japanat
02-05-2009, 01:15 PM
Hey, can anyone help me with my homepage coding? My current page is a fuzzy piece-of-shit template from Yahoo's small-business support, so I'm making one using IBM Japan's Home Page Builder, but the instruction kanji is harder than I can handle.

I'm trying to set the page bgcolor so that larger screens will still get the background color outside the main tables, and can't figure out how. If I put it in the body section, I can only color my page (width=761), not the outer margins. But if I put it after the <html>
(<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>),
it turns the whole page my background color and covers everything I've set like a thrown bucket of paint.

Any suggestions?

Gorlam
02-05-2009, 01:51 PM
yah, you have to specify the background color for the page.... sec

<html>
<head>
<title>Page title goes here</title>
</head>


<body bgcolor="#hexcodehere"> this code for the page background color

<font color="#hexcodehere"> this code decides the font color for all the text

<body>

<body bgcolor="#hexcodehere"> this code for the page background color within <body>

</body>
</html>

farstrider
02-05-2009, 07:18 PM
Put this in your header:

<style type="text/css" media="screen">
body {
margin: 0;
background-color: #hex;
}
</style>

CSS is more flexible than using HTML attributes, as well as being more standards compliant. Many modern browsers will hate you for NOT using CSS.

Janken
02-05-2009, 09:16 PM
Put this in your header:

<style type="text/css" media="screen">
body {
margin: 0;
background-color: #hex;
}
</style>

CSS is more flexible than using HTML attributes, as well as being more standards compliant. Many modern browsers will hate you for NOT using CSS.

He's correct, but CSS should really be a separate file. That way you can update the entire site using one .css file instead of putting the CSS in each HTML file and having to update each individual page.

<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />

Using this code, the HTML interpreter will look in the css folder under the root directory of the web server, for the file style.css and apply any CSS that's in style.css.

If you decide to do it that way I just stated, you'd just make a new file called style.css and put it in a new folder you create called css.

Inside style.css all you would have to type in would be..


body {
margin: 0;
background-color: #hex;
}


Then if you decide to ever change the layout, you can just change the text in that one file instead of changing it for every single page you have. Hope this helps.

japanat
02-05-2009, 11:11 PM
I looked in what HomePage Builder calls the site theme file (the CSS file is in it, named "hpb9tm10_16") and found the following:

/*-------------------- body --------------------*/

.hpb-body1 {
color: #818185;
font-size: 80%;
}

.hpb-body2 {
color: #444444;
}

.hpb-body3 {
color: #444444;
font-size: 80%;
}

.hpb-body4 {
color: #FF9900;
font-size: 205%;
line-height: 22px;
font-weight: bold;
}

.hpb-body5 {
}Should I put the media screen in before .hpb-body1 ?

Oh, and this is the HTML link in the page header:
<LINK rel="stylesheet" type="text/css" href="hpb9tm06_4.css" id="hpb9tm06_4">

farstrider
02-05-2009, 11:37 PM
Should I put the media screen in before .hpb-body1 ?

No. 'media="screen"' is somewhat superfluous and is only used as an attribute to an HTML <style> tag (note for the nitpickers: I know you could put an @media element in the CSS file, but let's not confuse him).

What you've copied there are classes (determined by the use of the "." prefixing the name), so they will only affect elements to which they are attached, such as:

<p class=".hpb-body1">blah</p>

Since there's apparently already a link to that external CSS file, you could just place the code I gave you previously at the top of the "hpb9tm06_4.css" file and all should be well.

japanat
02-06-2009, 01:47 AM
Since there's apparently already a link to that external CSS file, you could just place the code I gave you previously at the top of the "hpb9tm06_4.css" file and all should be well.Got it, thanks!

As you can tell, I'm a noobie when it comes to html, but I was able to go through the CSS file and customize all my colors on the site to get the look I wanted.

Appreciate your help! I'll probably be back with more dumb questions later.:hat:

IndianThrilla!
02-09-2009, 06:58 PM
I recommend this website for any tutorial on a subject web related. It will cover HTML, CSS, Javascript, etc.

http://www.w3schools.com/htmL/html_intro.asp

japanat
02-23-2009, 11:19 PM
Hi, I’m back again for more basic advice re: my homepage.

I’ve gotten it put together, uploaded it to the host server, and it works fine. My problem is that the search engines do not key on it at all. I’ve put my school name, 英会話, nearest station and 3 towns, the county all into the title bar (‘Something’ English Academy 英会話のソムシング・イングリッシュ・アカデミー 加古郡 播磨町 土山駅 稲美町 加古川 明石 エリア), and made sure the META keywords match those as well as a few others on the main page, and customized the keywords on other pages to match their contents.

And the search engines do NOT pick up my page. There are only 2 English schools (including mine) near my station, with another in the neighboring town. The other 2 usually show up within the first page, maybe the 2nd at the latest. Mine doesn’t. Not at all, not even if I go through all 16 pages of results. Tons of bot pages, and advertisers who just list school information out of the phone book in order to put their English ads on the same page appear by the hundreds. Even dentists who happen to be next to English schools in other towns appear!

I’ve even gone so far as to copy the keywords from the other schools and try them, and I still don’t show up on searches. Nor if I add one of the words from the name of my school into the search terms (although, then, at least, my school shows up in the adbots). Nor if I add 2 out of 3 words from the school name…. Not even if I add all 3…

Questions: I’ve followed advice, and used English commas with no space after the keywords, and I’ve tried it with a space after each keyword. What is the format for the keywords? I know many searchbots don’t zero in on the keyword any more, so other suggestions? And why do other schools using the same keywords and similar words in their title bars, or less even, come up quickly, when mine doesn’t show up at all unless you type the entire exact name?

I’ve gone way beyond frustration with this, as you can tell, and any advice would be greatly appreciated! Thanks!

farstrider
02-23-2009, 11:31 PM
The algorithms used by modern search engines are quite complex, but they generally take into account a combination of title, keywords, description, and text. The more often a certain word appears on any given page, the higher its perceived relevance is. Links are also important, however. Your page will get higher rankings based on the number of references to it that the bots find elsewhere (want proof? Just try Googling "the greatest living American").

There is also one other, very important factor: patience. The Internet is a big place, and it will take time for all the creepy crawlies to locate your web site. Especially if it has few, or no, links to it elsewhere.

japanat
02-24-2009, 12:14 AM
What about setting robots to follow internal links? I had thought you could only set them to not follow, but there was a web page in Japanese that seemed to indicate that you could (my kanji isn't quite up to that page, I'm afraid).

farstrider
02-24-2009, 12:52 AM
AFAIK, they should follow internal links automatically. It's external links that will lead them to your web site.

blank slate
02-24-2009, 02:29 AM
I went ahead and visited your site and checked out your code. Damn near everything is in javascript and you have hardly any text, meaning that the bots have nothing to read, which is why you aren't showing up.

japanat
02-25-2009, 09:26 AM
Yeah. I used IBMs HomePageBuilder, and didn't realize that it had converted much of the script into Java during the upload process; basically changing all my animated text, rollovers and logos. Since I built my logo from their wizard, as well as my rollover photos, etc, it all ended up in Java. Shit!

Now I have to try to teach myself how to do some of the same things in HTML, but I'm sure I can't do anything as well w/o the Java. I have, however, figured out how to make some half-assed buttons which switch from English to Japanese. Now if I can figure out how to make them loop without Java...

I'll probably have to reformat the index page, put in some regular text so the search engines have something to grab on to.

farstrider
02-25-2009, 11:13 AM
You're page is using javascript, which is very different from Java. Anyway, if you want to make buttons that switch from English to Japanese, you could always make them animated GIFs.

japanat
02-26-2009, 12:37 AM
Sorry, I looked up the difference on Wiki. I'm trying to make animated buttons now, but my animator requires me to set the sequence by hand. Is there any command that will allow me to set the sequence once, then have it repeat?

Sorry about all the basics, but I obviously never took the time to learn basic programming, and am now paying the price.

farstrider
02-26-2009, 12:27 PM
I used Adobe ImageReady for all my animations. I haven't actually done any since university (the first time); but, as I recall, you just have to set up the frame sequence in the animation palette, set the interval between each frame, then select whether you want the sequence to repeat forever or just run through once. Pretty easy, really.

SlickWilly440
02-28-2009, 03:03 PM
This site is pretty awesome: http://w3schools.com/

It has a bunch of tutorials about html, css, xml, javascript, php, and much much more. Each type of language is broken down into easy,short tutorials with example code and an in browser editor that makes learning really fun and fast. You can pretty much learn HTML, XHTML, CSS in less than a day.