SitePoint Sponsor

User Tag List

Results 1 to 21 of 21
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question eliminate margins for table

    How can I eliminate the margins on my page and get the table to lay up against the left and top edge. I'm using this code but I know it doesn't validate.

    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    With CSS:

    Code:
    <STYLE>
    BODY {margin:0px;}
    </STYLE>
    oughta sort you out, and validate too...
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, if someone could screw up something really simple it's me. I can't get this code to work. Here is the address of the ad I'm working on. When the page comes up just click on Copy Plus.

    When I first started this project I tried to use a style to control the margins but I could never get it to work. What am I doing wrong? Just to give you a little background...there is a CSS file for the site but I was going to keep all the ads with inline CSS so that it wouldn't get confusing.

    barbaraGualalaBusiness.info/ads/copyplusdraft.htm

  4. #4
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry that link won't load for me. Essentially this is how you would use it:

    Code:
    <HTML>
    <HEAD>
    <TITLE>Hello</TITLE>
    <STYLE>
    BODY {margin: 0px;}
    </STYLE>
    </HEAD>
    <BODY>
    TEST!
    </BODY>
    </HTML>
    Try that code with the STYLE tags in and out, and you should see the difference.

    P.S. Which browser are you using?
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  5. #5
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is thej source code for the page:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Copy Plus</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="pragma" content="no-cache">
    <style><!--
    body,p,td,table,ul,li{
    font-family:Arial,sans-serif'}
    body{margin:0px}
    -->
    </style>
    </head>
    etc.
    -------------------
    As you can see I have another style being used. Can you give me a correction from this?
    -------------------
    I'm very curious as to why you can't access the page. This is the first time I've used this forum and perhaps I didn't code the URL correctly. Here is the address of the page, you just have to click on Copy Plus. As you can see it is a directory for our small area. You can just copy and paste this and I'll try to code the URL again also.
    www.gualalabusiness.info/ads/copyplusdraft.htm

    copy plus draft ad

  6. #6
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    K, change it to this:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <title>Copy Plus</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <meta http-equiv="pragma" content="no-cache"> 
    <style><!-- 
    body,p,td,table,ul,li{ 
    font-family:Arial,sans-serif; margin:0px} 
    --> 
    </style> 
    </head>

    That should do it.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  7. #7
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can see the change in IE 5.5 but not in Netscape 4.75 or Opera 6.03. I am using Dreamweaver and these are the secondary browsers I use. Is this something I should just accept or is there a reasonable way to code this for all browsers?

    When I tried to HTML validate this page it said there was an error after <style>and before <!--. The error read "required attribute "Type" not specified. Is there a correction for this?

    A little background on myself:
    First computer four years ago. Taking classes online in Basic Computer, HTML, PSP, Dreamweaver, Fireworks, CSS, Homesite, Javascript, Printers, Scanners, Digital Camera, etc. Trying to stuff a lot of information into an "older blonde brain". lol
    Long term Goal: To build my online directory website that validates correctly . If I can do this I feel I could go on and build websites for a small business.
    Short term Goal: To convert Dreamweaver 4 so that it codes correctly in XHTML. To understand CSS better. To find a mentor that I can ask questions and understand their answers (without the flames and put downs). I figure I'll have to find a Fireworks mentor somewhere else but I'm looking.

    barbara

  8. #8
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
    <html> 
    <head> 
    <title>Copy Plus</title> 
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    <meta http-equiv="pragma" content="no-cache"> 
    <style type="text/css">
    body, p, td, table, ul, li {
    font-family:Arial, sans-serif; margin:0px
    }
    </style> 
    </head>
    Commenting out the CSS with the <!-- ... --> is used as a workaround method for getting those browsers that do not understand css to ignore it.

    NN4 supports the css margin attribute so it's not neccessary to comment it out.

    I'm actually quite surprised Wierdbeard didn't put in the type="text/css" attribute in his example.
    I guess he was just being economical

    Let us know how you get on
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  9. #9
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Incidentally, if you are a Dreamweaver user then you might want to consider upgrading to MX as this has vastly superior support for XHTML code (production) than 4.

    CSS is a real no-brainer once you get the basics down.
    It can work wonders for keeping the various aspects of your code separated and clean.

    Try to get in the habit of using external CSSfiles rather than planting in the header.
    Definately try to avoid using CSS inline.

    Inline CSS is the most problematic for certain browsers.

    External CSS is the way to go

    A great resource is W3Schools.com which has many well-organised sections for the specifics of stuff like CSS (including reference list) and XHTML (including reference list).
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  10. #10
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Why am I adding <style type="text/css"> ? Is this something like a Doc Type that tells the browser what kind of CSS it is?

    2. I live in a very rural area and it is very likely that there will be older browsers still around here. I thought the <!-- --> commenting out would prevent the code from showing with these browsers. It probably is a moot point because I suspect the javascript I use to bring up the ad windows probably won't function in these older browsers anyway. So your advice would still be to delete the comment here?

    3. The reason I was putting the CSS inline for the ads was that I thought it would get too confusing. There will be over a thousand ads. I was trying to keep the CSS for the main structure of the site separate. Of course, now that I am writing about this I suspect that I could have two CSS files, one for the main site and one for the ads. Am I on the right track?

    4. Should I be in a panic to get Dreamweaver writing XHTML? I started a tuitorial to convert my configuration and got some of it changed and then my computer messed up and a local tech cleaned my entire drive and I lost everything. This will explain why some of the ads have the XHTML doc types. Can you give me instructions about converting DW to XHTML or do you feel it is necessary?

    4. I am looking forward to DWMX but I will have to buy a new computer first. At five years old mine is pretty much running at it's maximum ability.

    Thank both of you so much for such nicely written replies.

  11. #11
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I somehow missed the last sentence and am now reading up on XHTML. I definately realize it's importance, especially since this is a business directory which hopefully will be used by handhelds.

    After I finish understanding what XHTML is I'll come back and start asking how to convert Dreamweaver. lol

    Have a nice Holiday...

  12. #12
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Welll XHTML is really a natural progression from HTML, so if you're happy writing [compliant]-HTML then it shouldn't be a problem. I have never really been one to use any WYSIWYG so I'm afraid I can't help with switching DW over or whatever. You might consider posting a question in the "Web Dev Software" forum.

    Good luck
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  13. #13
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question CSS ugh!

    Ok, I spent the day going over the CSS from W3C. Decided to stay with Internal Style Sheets on each ad until I really get the concept down.


    The W3C Validator says the color #990000 doesn't exist. My list says it a web safe color.

    Netscape 4.75 won't recognize the 0 margins. How do I work around this and still validate?

    Opera 6.3 won't recognize the margins either. How do I work around this and still validate?

    Here is the ad draft

  14. #14
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Opera has a uniquelly nonstandard way of interpreting margin attributes.

    You need to use padding [i]as well[/b] to cover Opera.

    Netscape should recognise margin just fine.
    Be sure that you are adding a unit (0px)
    It isn't strictly neccessary (as 0px = 0pt = 0em, etc...), but it may be the reason isn't seeing it.

    It may also be something to do with the clip attribute that you have in the body attribute set.
    You need to add the dimensions of the clip for it to validate correctly, e.g...

    clip : rect(0px, 436px, 136px, 0px);
    or
    clip : rect(auto, auto, auto, auto);
    (based on clip : rect(top, right, bottom, left);

    Using auto tells the browser to use the dimensions (height/width values) of that object to define the clipping region for the object.

    I am wondering if they are only there because Dreamweaver hiccupped.
    (I've just noticed an 'incomplete' clip attribute (like yours) attached to one of my textarea css classes that wasn't there before and wasn't put there by me (intentionally))

    What are you trying to do by having that there?
    Not quite sure what effect setting a clip would have on the body of a page anyway.

    If they are not meant to be there at all, then take them out manually.

    W3C should also have no problems with #990000.
    I am thinking that it may have been something to do with your formatting or use of non-compliant attributes that mistakingly triggered the W3C to fail that colour attribute.

    If you find that correcting those things mentioned here doesn't help validate the CSS fille, then can you put up a link to the CSS file that was failing on all the points you mention?
    (I'm assuming by the absence of any #990000 values in the CSS currently being used by that linked page that it is not the same as the one you were originally having problems with.)
    Last edited by Bill Posters; Jul 5, 2002 at 21:43.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  15. #15
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Color Issue---When you say the absence of the #990000 value I suspect you are looking at the first ad I loaded. I have a non-cache meta tag so I presumed that only the new ad would show. Let me know if this is the problem.

    This is the code for the ad (not the directory page) I now have loaded:
    <html>
    <head>
    <title>The Loft</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="pragma" content="no-cache">
    <style type="text/css">
    <!--
    body {margin: 0px;} /* NN ignores the margin */

    p,td,ul,h3 {font-family: Arial, sans-serif;
    font-color: #990000; /* This color never has come up Validator says it doesn't exist */
    margin-left: 150px;}


    -->
    </style>

    </head>

    <body bgcolor="#FFFFFF">
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td><img src="loft.jpg" width="400" height="266" alt="The Loft"></td>
    </tr>
    <tr>
    <td>
    <ul>
    <li><font size="+1">Art Supplies</font></li>
    <li><font size="+1">Beads</font></li>
    <li><font size="+1">Crafts</font></li>
    <li><font size="+1">Fabric</font></li>
    <li><font size="+1">Yarn</font></li>
    <li><font size="+1">Needlework</font></li>
    <li><font size="+1">Gifts</font></li>
    <li><font size="+1">Quilting Supplies</font></li>
    </ul>
    <h3>707 / 884-4424</h3>
    <p>The Sunstrom Mall is located at<br>
    39225 S. Hwy One</p>
    <p>mailing addressbr>
    P.O. Box 852<br>
    Gualala,Ca 95445</p>
    <p>Ownerbr>
    <font size="+1">Marva Jacobs</font></p>
    </td>
    </tr>
    <tr>
    <td bgcolor="#CC6633">&nbsp;</td>
    </tr>
    </table>
    </body>
    </html>

    -------------
    I will work on the Opera padding code.

    ------------
    I will work on the Netscape and clip issue.

    I'm going into town today (it takes me two hours to get there) so I won't get to these issues till later.
    Thanks for the nice help.

  16. #16
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bill - i'll reserve my thoughts for myself on that "Dreamweaver user" comment

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  17. #17
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Horsebreath
    Color Issue---When you say the absence of the #990000 value I suspect you are looking at the first ad I loaded. I have a non-cache meta tag so I presumed that only the new ad would show. Let me know if this is the problem.
    Doh!

    As I said, the color value (#990000) is fine.

    It's just that the attribute font-color doesn't exist in standards.

    Simply use color and it'll clear fine


    Originally posted by Flawless_koder
    Bill - i'll reserve my thoughts for myself on that "Dreamweaver user" comment
    Don't knock it, buddy. At least I can spell it correctly

    Fwiw, DW is just one part of my workflow.
    I spend most of my time in BBEdit once I've got the shell sorted.
    As a designer who also knows how to code, I find the visual approach much more in line with the methodology that drew me towards design in the first place.
    However, knowing the DW doesn't create perfect code (though better than most), I am perfectly willing and able to get under the bonnet and clean it up to fit my own preferences for code formatting.
    I find, in my workflow, DW is a valuable and conducive tool that let's me visually create 'visual' sites more fluidly.

    How you build sites is your choice.
    Ditto with mine.
    There is no best or worst way to build a site other than whatever way best suits person building the site.

    The bottom line is, if the code works how and where you want it to, it doesn't make a blind bit of difference how you ceated it.
    Last edited by Bill Posters; Jul 6, 2002 at 00:46.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  18. #18
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know - but i enjoy nagging you about it OH so much

    I don't mind dreamweaver too much. I just don't like
    what it does to scripts.
    People come around asking why something isn't working, and i take one look at the code and nearly fall over.

    But for normal work - yeah - it's great - i guess.

    ( not that i'd ever use it though )

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  19. #19
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    in the right hands dreamweaver still is quite a valuable tool...it's when you let glorified typists loose on it that you get the horrible horrible stuff we all know it can do
    anyway, there IS a point to this post: just stumbled across this little article on A List Apart about how to modify DW to be more XHTML compliant... http://www.alistapart.com/stories/dreamweaver/ ... it's good stuff, i reckon
    redux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  20. #20
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    I realize that working with people like me is a drag. Honestly, I do have a good sense of humor and some day you will not need a 2X4 to pound the information into my head...but until that day comes...

    More sucess than failure!
    1. Finally got the "hint" that font-color should just be color.

    2. Does my no-cache tag work or were you looking at a cached file? I didn't understand your Duh remark. If the ad file is cacheing then I need to learn a new trick.

    3. Netscape is still not showing a 0px margin.

    4. Hooray! The page validated in HTML when I remembered to put the Doc Type in.

    5. I kept beating my head against the wall trying to validate the CSS. Then a light at the end of the tunnel said "This is an HTML file and not a CSS file, dummy" Is this light trying to tell me that Internal CSS isn't validated in an HTML file?

    6. I just picked up my grandchild to vacation with me for the next two weeks. Do you know how depressing it is how easy they play computer games while you struggle to understand the rules. lol

    I'll check out the XHTML/Dreamweaver conversion link. (This should be fun.... :-O barbara

  21. #21
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nono, i wasn't trying to be aggy at you.

    It's all good

    I realize that working with people like me is a drag. Honestly, I do have a good sense of humor and some day you will not need a 2X4 to pound the information into my head...but until that day comes...
    Nono, not a drag at all.
    I'm just glad that even though I may not be guru-standard yet, I can still be useful to someone.

    More sucess than failure!
    1. Finally got the "hint" that font-color should just be color.
    Not a hint at all. I only noticed the font-color thing in my last post.
    If it seems that I was 'shouting' that's just because I'd misplaced some bold tags in that post.
    Sorry (fixed it now)
    That's all it was

    2. Does my no-cache tag work or were you looking at a cached file?
    Take a look here for some info about how to prevent caching and the limitations of the pragma method.
    I know next to nothing about that specific subject, it's just some reading I stumbled on when trying to find out a way to help.
    I know for sure that the pragma no-cache method doesn't work with IE5 which is what I'm using to view it with.

    3. Netscape is still not showing a 0px margin.
    I'm using your ealier link to the "ad draft" as reference.
    If the file there is not the one I should be looking at let me know.
    I've checked in NN4.7 and it appears ok to me.

    Perhaps you could put up a link to a gif/jpg screenshot that shows me/us what you see when you view in Netscape.

    4. Hooray! The page validated in HTML when I remembered to put the Doc Type in.
    Good good. Getting there

    5. I kept beating my head against the wall trying to validate the CSS. Then a light at the end of the tunnel said "This is an HTML file and not a CSS file, dummy" Is this light trying to tell me that Internal CSS isn't validated in an HTML file?
    Best to get in the habit of pushing *all* css attributes out to an external file and allowing the html tags and classes to set the style according to the stylesheet.
    I can't say for sure if inline or header CSS will validate through the online validator at W3C because by ime I find it, I'd already got in the habit of using external CSS files.

    6. I just picked up my grandchild to vacation with me for the next two weeks. Do you know how depressing it is how easy they play computer games while you struggle to understand the rules. lol
    As long as you have the essentials down like programming the video you'll squeeze by.
    I personally still prefer the 'retro' games though have been bitten on more than one occasion with "a game or two" on PS2 turning into all-nighters.
    That being said, I'm not a big fan of this drive for 'realism'.
    My idea of first-person shoot-em-up would be me running round the streets with a King Edward potato in one hand and a spud-gun in the other.
    And if I really had to have that 'realistic fight experience' then I'd go out and find a small guy to pick on


    btw, I've noticed that in the 'ad draft' file, you have linked to the external CSS file twice; once in the header and once again half-way down the code.
    Not a problem in itself, but not needed
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •