Old 08-29-2006   #1 (permalink)
Intermediate User
 
Neil_8_24_93's Avatar
 
Join Date: May 2006
Posts: 96

Send a message via AIM to Neil_8_24_93 Send a message via MSN to Neil_8_24_93
CSS Help PLEASE READ!!!

OK. For some strange reason my CSS margins arent working I tried several different browsers but all of them are the same. Take my text field for example here is my code:


<div class = "username">
<form>
<input type = "text" name = "username" class = "field" value = "username" onfocus="if (this.value==this.defaultValue) this.value='';" onblur= "if(this.value=='')this.value=this.defaultValu e"/>
</form>
</div>

here is my CSS:

.username{
margin: 0px 0px 0px 0px
}

what ever i make my margin's the text box doesnt move can someone please help me? this just started recently its never done this before.
Neil_8_24_93 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08-29-2006   #2 (permalink)
A$s On Fiyah
 
ecntrc's Avatar
 
Join Date: May 2005
Location: Ewa Beach, Hawaii
Posts: 601

Send a message via Yahoo to ecntrc
why do you have 4 margins? shouldnt you name them left margin or something? Im not that smart with CSS but to me that dont look right.. sorry I couldnt of better help. Ill look it up in my CSS book and get back to you later..
__________________
google is my lover, whos yours?
ecntrc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08-29-2006   #3 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 43

dont use px for zero,
and just a trick, if your all values is equal to eachother than just write one of them not all of them (eg margin:0

@ecntrc, margin-left, margin-right, margin-top, margin-bottom, those values are still available in css but meaningless to use them since margin: 1px 2px 3px 4px; would mean 1px from top, 2px from right, 3px bottom, 4px from left.

margin:0; would mean zero for all sides
metsatöll is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08-29-2006   #4 (permalink)
Be Unique. Be Heard.
 
Jacorre's Avatar
 
Join Date: Jul 2006
Location: USA
Posts: 489

Have you tried applying it to the form tag instead? Forms may have some sort of spacing default.
__________________

Jacorre Studios Blog
Jacorre is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08-29-2006   #5 (permalink)
A$s On Fiyah
 
ecntrc's Avatar
 
Join Date: May 2005
Location: Ewa Beach, Hawaii
Posts: 601

Send a message via Yahoo to ecntrc
Quote:
Originally Posted by metsatöll View Post
dont use px for zero,
and just a trick, if your all values is equal to eachother than just write one of them not all of them (eg margin:0

@ecntrc, margin-left, margin-right, margin-top, margin-bottom, those values are still available in css but meaningless to use them since margin: 1px 2px 3px 4px; would mean 1px from top, 2px from right, 3px bottom, 4px from left.

margin:0; would mean zero for all sides
yeah thats what I meant, see I know CSS but I dont you know. I knew that didnt look right but luckily someone else could help him.. thats good to know.. thanks
__________________
google is my lover, whos yours?
ecntrc is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08-29-2006   #6 (permalink)
Recursively call who?
 
GoldNetX's Avatar
 
Join Date: Nov 2003
Location: Pittsburgh, PA
Posts: 294

Send a message via AIM to GoldNetX
I am not sure on it, but I think that the margin attribute only applies to elements on a page that are positioned relatively. Meaning you need to define the position attribute as relative.

Try this:

Code:
.username{
position: relative;
margin: 0;
}
__________________

www.gusmayo.com
- Maybe a story or two -


www.jaloobie.com
... your new home ...

www.webinkproductions.com
- professional web application design -

Last edited by GoldNetX; 08-29-2006 at 05:23 PM. Reason: Removed px from margin, should just be 0.
GoldNetX is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08-29-2006   #7 (permalink)
Registered User
 
Join Date: Aug 2006
Posts: 43

I didnt check it well yesterday
@goldpix, margin: 0px; is not right way to right. It should be margin:0;

@neil, try that one,

HTML Code:
<html>
<head>
<style>
.username{
    position: relative;
    margin: 0;
    }  
</style>
</head>

<body>
<div class = "username">

<form class = "username">
<input type = "text" name = "username" class = "field" 
value = "username" onfocus="if (this.value==this.defaultValue) this.value='';" onblur= "if(this.value=='')this.value=this.defaultValu e"/>

</form>
</div>
</body>
</html>
metsatöll is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 08-29-2006   #8 (permalink)
Intermediate User
 
Neil_8_24_93's Avatar
 
Join Date: May 2006
Posts: 96

Send a message via AIM to Neil_8_24_93 Send a message via MSN to Neil_8_24_93
Thank you all I found the problem.....my linking I didnt link the HTML page to the CSS page properly. Sorry guys.
Neil_8_24_93 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Old 09-02-2006   #9 (permalink)
Registered User
 
Alex McKee's Avatar
 
Join Date: May 2006
Posts: 28

Furthermore, you might have needed to also set 0 padding
Alex McKee is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML Question - PLEASE READ Neil_8_24_93 HTML / PHP / ASP / JS 6 08-13-2006 05:11 PM
PHP BB Question (Please Read) Neil_8_24_93 HTML / PHP / ASP / JS 5 08-01-2006 10:17 PM
Want to make a website? Read this. Young Spartan HTML / PHP / ASP / JS 16 06-30-2006 02:12 AM
interesting read Milkdrop General Discussions 3 08-07-2004 04:27 AM
Help: Making images links (it isn't what you think...read) kp606-Epsilon Adobe Photoshop 2 07-15-2004 02:14 PM


All times are GMT +1. The time now is 05:53 AM.
Content Relevant URLs by vBSEO 3.2.0

Design & Content © BioRUST 2008 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT