Web Design Forums

HTML and CSS Help

Having problems with these web design scripting? Ask here.

Lots of questions relating to HTML and CSS



Site of the Month Voting - Now Open. CAST YOUR VOTE NOW!

Reply
 
LinkBack Thread Tools
Old April 5 '06, 05:11 PM (#1)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Lots of questions relating to HTML and CSS

Ok, I am trying to redo my site in CSS because I'm sick of spending hours updating ever page of my site. Now lots of people say "Oh CSS is so wonderful, it's easy and I love it!" I do not find it easy at all.
Here are my questions:
1. Let's say I have a column on 50 pages that I want to be the same, but I need to change its content. What is the best way to do this without editing 50 pages? Don't say CSS, because I can't put HTML and Javascript in CSS files.
2. How do you center tables in CSS? Please don't point me to a totorial, I've read a lot of these, and none of them have given me an answer. I want the table to accually be centered, not x pixels from the left or right.
3. How do you put objects side by side in CSS? I have three tables I want side by side, but they always end up on top of each other. How do I fix this?
4. What is the best way to convert 250 pages from HTML to CSS without working for 10 hours straight?
Sorry if I'm a little bit blunt, I've ask a lot of people these questions and never gotten any asks that were useful.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 5 '06, 06:24 PM (#2)
Eddy Bones is offline
ColdFusion Programmer
 
Eddy Bones's Avatar
 
Join Date: January 2004
Location: Washington, USA
Posts: 1,054
Eddy Bones is just really niceEddy Bones is just really niceEddy Bones is just really niceEddy Bones is just really nice
1) The most plausible solution is to use a PHP include.
You would use something like below in place of the content to be shown (you'd have to put it on each page, of course), and in the file.ext you would put that content.
PHP Code:
<?php include("file.ext"); ?>
This is assuming you have PHP support.

2) Define the table's width in CSS, and then use margin: 0px auto;
I believe this will work, though I may be mistaken. I haven't used CSS on tables very much.

3) Tables automatically create a line break, so I think you'd have to use clear: none; on them. Again, I'm not completely sure of this solution, but it's worth a try.

4) I don't think you have much of a choice, unless you can use some sort of find and replace function in Dreamweaver or some other program. Would beat scanning the code and replacing stuff by hand. But you're bound to have to do a lot of work to fix it.

Last edited by Eddy Bones; April 5 '06 at 06:25 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 5 '06, 09:24 PM (#3)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Thanks for the help.
I do have Dreamweaver, so if you know of a repet fuction that would be very helpful.
Is it possible to use PHP tags on a page that doesn't end in .php?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 5 '06, 09:45 PM (#4)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Darn, the php tag didn't work...the table came up blank.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 12:59 AM (#5)
audiofreak9 is offline
[hand]code[/hand]
 
audiofreak9's Avatar
 
Join Date: April 2005
Location: NJ
Posts: 340
audiofreak9 will become famous soon enough
1. Make the column a <div> instead of a table or table cell. Assign each of those 50 column (divs) the same class on each page they appear, changing only the content for each page, not the class. They will have the same look/feel but different content. Fortunately if you make one CSS change ALL of the 50 columns look/feel will change on each page.

2. Wrap the table(s) in one <div> that has the CSS code: margin: 0px auto;

3. I believe assigning the table(s) a class that includes the CSS: display: inline would work. Or wrap each in a <div> and assign each <div> the following CSS: float: left;. Don't forget you will nead a clearing <div> for the floats: clear: both;

4. Make a finalized template that will be for all the 250 pages. Then just copy/paste the content into the template's HTML, saving each under the correct page name. YES it will suck! Includes would make this most easy as Eddy stated . Typically the header, navigation, and footer don't change, allowing you to just write them once and globally include them.

I'm sure you have heard this before, try to avoid tables, using <div> and <span> instead.

Last edited by audiofreak9; April 6 '06 at 07:34 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 08:45 AM (#6)
karinne is offline
\m/ \m/
 
karinne's Avatar
 
Join Date: December 2003
Location: Aylmer QC Canada
Posts: 1,608
karinne is a jewel in the roughkarinne is a jewel in the roughkarinne is a jewel in the roughkarinne is a jewel in the rough
1- If you're not going to be using PHP in your site I suggest Server-Side Includes (SSI).

- Rename your pages to have the .shtml extension instead of .html .

- The portion you want to include in all your files, put it in a separate file and call it whatever.inc (it can be .html or .ssi - extension doesn't matter here)

- In your file you want to include this whatever file you put

Code:
<!--#include file = "whatever.inc" -->
That's it ... you're done.

There's more info in a tutorial on this site - The Basics of Server Side Includes -

Last edited by karinne; April 6 '06 at 08:46 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 04:30 PM (#7)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Ok, how to I use these tags? They don't work. I put in all the right stuff and rename the files and upload it. When I go to my site, it just says "error processing command" in the spot where the content should have been.
What is wrong? Also, is there any way to use these tags without changing the name of ever single page? That also includes all the links, and it would take hours. I've seen sites that use php tags on pages ending in .html, how do they do this?
I have a javascript/CSS menu on my site, and it uses JavaScript tags to put the menu on ever page. All I have to do it update one file and the whole site updates. Is there any way I could use Javascript tags to update multiple pages at once?

Last edited by stargate3216; April 6 '06 at 04:49 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 06:52 PM (#8)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Quote:
Originally Posted by audiofreak9
2. Wrap the table(s) in one <div> that has the CSS code: margin: 0px auto;
setting the margin: 0px auto only puts the columns on the far left part of the page, and I don't know if it's possible to put all the tables in one <div>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 07:18 PM (#9)
audiofreak9 is offline
[hand]code[/hand]
 
audiofreak9's Avatar
 
Join Date: April 2005
Location: NJ
Posts: 340
audiofreak9 will become famous soon enough
Quote:
Originally Posted by stargate3216
setting the margin: 0px auto only puts the columns on the far left part of the page, and I don't know if it's possible to put all the tables in one <div>
Sure it is, it's like the <body> tag wraps the body of the webpage. Place it before the table(s) start, and at the end of the table(s), wrapping the table(s).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 07:25 PM (#10)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
But then how do I specipy tables? Most of the time its like
<div id=header>dfjsdlkjfnasd;lkfa</div>
<div id=body>sfasdfasdfasdf</div>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 07:30 PM (#11)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Another question:
My site is in one big folder, and my site is pretty big, so it makes it really hard to find things. I would make subfolders exept when I do it wrecks all my links and my javascript menu. Lets say I want a to make a link on epsiodes/101.htm to actorbios/RDA.htm. If I just put actorbios/RDA.htm as the url of the address, the link takes me to epsiodes/101.htm/actorbios/RDA.htm which doesn't exist. How do I correct this problem?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 07:37 PM (#12)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
I think I answered my own question. You'd go ../actorbios/RDA.htm right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 07:49 PM (#13)
audiofreak9 is offline
[hand]code[/hand]
 
audiofreak9's Avatar
 
Join Date: April 2005
Location: NJ
Posts: 340
audiofreak9 will become famous soon enough
/ = the root folder
./ = the current folder
../ = one level up the folder tree

Last edited by audiofreak9; April 6 '06 at 07:51 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 07:53 PM (#14)
audiofreak9 is offline
[hand]code[/hand]
 
audiofreak9's Avatar
 
Join Date: April 2005
Location: NJ
Posts: 340
audiofreak9 will become famous soon enough
Quote:
Originally Posted by stargate3216
But then how do I specipy tables? Most of the time its like
<div id=header>dfjsdlkjfnasd;lkfa</div>
<div id=body>sfasdfasdfasdf</div>
It seems FF doesn't allow the tables to line up inline, even when wrapped in a <div>.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 10:28 PM (#15)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Quote:
Originally Posted by audiofreak9
/ = the root folder
./ = the current folder
../ = one level up the folder tree
../../ is two levels up right?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 6 '06, 10:43 PM (#16)
audiofreak9 is offline
[hand]code[/hand]
 
audiofreak9's Avatar
 
Join Date: April 2005
Location: NJ
Posts: 340
audiofreak9 will become famous soon enough
I do not believe so. I would start at the root at that point and add the folders from there.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 7 '06, 01:32 PM (#17)
mlseim is offline
WDF Staff
 
mlseim's Avatar
 
Join Date: April 2004
Location: Cottage Grove, Minnesota
Posts: 3,359
mlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud ofmlseim has much to be proud of
With all of your pages, how much is common between the pages?

I'm still thinking you could use PHP ... I just think you did something wrong
when you did the include. And the name of the pages should have the
extension .php (example: index.php instead of index.html )

Once you have one file that defines the common parts of all your pages, like the
header, footer, basic CSS layout ... that page becomes your "template". Using PHP,
you go into the pages with some variables that define what content will appear in
the content areas of the page.

An example of this is here: http://www.palosantodesigns.com/

The main page is "index.php" ...
Now, mouse over the links in the navigation column (on the left) and look
at the URLs for those links. They all refer to a PHP page called: "page.php"
with a variable assigned that tells the PHP script which content to put into
the content area. So in effect, the whole site (28 pages) has about 3
actual PHP pages and a bunch of text files (for the content) ... and one
CSS style sheet file. With 1 alteration to the CSS file, every page gets
affected as they all use the same CSS file. To change the content on any
page, a plain text file is edited and uploaded by the site owner.

Does this make sense? It's hard to explain on this forum ...

EDIT:
I just noticed this sentence you made on your first post:
"Don't say CSS, because I can't put HTML and Javascript in CSS files"

CSS is "cascading style sheet" ... in the example above, it's one text file
that defines the look and layout for specific areas <div>'s on the web pages.
Your HTML file loads the .css file in the <head> section of each page. Now,
you can access the various <div>'s within your HTML file and do Javascripting,
and PHP stuff, you can even use <tables> There's nothing wrong with mixing
tables and CSS ... it's done all the time, especially for tabular data such as
image galleries, calendars, and other information taken from a database.



.

Last edited by mlseim; April 7 '06 at 01:44 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 7 '06, 04:32 PM (#18)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Quote:
Originally Posted by audiofreak9
I do not believe so. I would start at the root at that point and add the folders from there.
Umm...ok. I have a javascript menu and in it I have to put links to different folders. Heres the file structure:
/www/
........./sg1/
................./eps/
............................/file1
......../sga/
.............../eps/
.........................../file2
lets say I need to make a link from file1 to file2. How would I do this?

Last edited by stargate3216; April 7 '06 at 04:33 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old April 7 '06, 05:26 PM (#19)
stargate3216 is offline
WDF Member
 
stargate3216's Avatar
 
Join Date: March 2006
Posts: 23
stargate3216 is an unknown quantity at this point
Well I answered my own question again by reading the post about links again.
Here's a different question. How do I make the image that this random image selecter shows into a link? Here's the code.
EDIT: I'd like the picture to become a link, not the code its self.
Code:
<HEAD>
<script language="JavaScript">
theImages[0] = 'banner1.jpg'
theImages[1] = 'banner2.jpg'
theImages[2] = 'banner3.jpg'
theImages[3] = 'banner4.jpg'
theImages[4] = 'banner5.jpg'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}
//-->
</script>
</HEAD>
<BODY>
<script language="JavaScript">
<!--
showImage();
//-->
</script>
</html>

Last edited by stargate3216; April 8 '06 at 08:34 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Web Design Forums » Programming Help » HTML and CSS Help

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
specify link location with css, not html raspberryh HTML and CSS Help 3 April 3 '06 08:21 PM
Can basic HTML and CSS make a good site?/Coding: College or web resources? wilson General Web Design Discussion 8 March 22 '06 10:02 AM
Newbie questions re: menu drop downs and CSS kobuk HTML and CSS Help 4 January 18 '06 01:14 PM

 
User Infomation
Your Avatar

Site Of The Month
Nominate Your Site Now!

Advertisement
WolfCMS.org

Latest Articles
- by RickM
- by bfsog

Advertisement

Partner Links



All times are GMT -4. The time now is 02:01 PM.


WebDesignForums.net is Copyright © 2010 RikeMedia.

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164