CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2008 Tags:
Item Type: NewsGroup Date Entered: 1/22/2008 3:01:59 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 39 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
prizzy
Asp.Net User
CSS problem in Form tag in VS1/22/2008 3:01:59 AM

0/0

Hello, I am beginning to learn CSS in VS, and have encountered an slight problem.  I am making a simple box, using CSS and a div tag, with a 20px margin all the way around.  It looks fine in my editor, but when I run the page, there is a 100px margin on the top??  It seems to be some default value in the <form> tag, because when I take out that tag, or set it's top margin to -100px, it works fine.  Let me know if I am going crazy or not please!!!

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title>Untitled Page</title>

<link href="StyleSheet.css" rel="stylesheet" type="text/css" />

</head>

<body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server" />

<div id="parent">

<div id="child">

</div>

</div>

</form>

</body>

</html>

 

 

CSS rules:

 

body

{

margin:0;

padding:0;

}

div

{

height:100px;width:100px;

}

 

div#parent

{

margin:10px 20px;background:yellow;

}

 

jamesqua
Asp.Net User
Re: CSS problem in Form tag in VS1/22/2008 3:27:05 AM

0/0

Yeah, I remember having this same problem.  Have you tried setting the margin and or padding for the form to 0px with css? 

prizzy
Asp.Net User
Re: CSS problem in Form tag in VS1/22/2008 3:42:26 AM

0/0

Yes, 0px does not work.  It must be -100px.  I have been beating my head off my laptop over this, and have found some other little quirks.  It seems that if I use the css code below it works perfectly.  I had to eliminate the stand alone div rule, and put the height and widths inside the individual rules.  That makes no sense, since it should cascade down.

body

{

margin:0;padding:0;

}

 

div#parent

{

margin:10px 20px;

background:yellow;

width:100px;height:100px;

}

 

div#child

{

margin:20px;

background:lightyellow;

width:100px;

height:100px;

border: 1px solid gold;

}

 

If I pull the height rule out like this, it adds the 100px margin at the top.

body

{

margin:0;
padding:0;

}

 

div

{

height:100px;

}

 

div#parent

{

margin:10px 20px;

background:yellow;

width:100px;

 

}

 

div#child

{

margin:20px;

background:lightyellow;

width:100px;

border: 1px solid gold;

}

jamesqua
Asp.Net User
Re: CSS problem in Form tag in VS1/22/2008 4:12:40 AM

0/0

So when you do this

form{margin:0px;padding:0px;}

you still get the 100px area in the form?

prizzy
Asp.Net User
Re: CSS problem in Form tag in VS1/22/2008 4:24:34 AM

0/0

Yes.  The only way I get rid of the margin is if I put the width and height in the div#parent rules.  Could it be something to do with the doctype?  Perhaps collapsing margins?

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Dreamweaver CS3 Bible: Master Every Aspect of Dreamweaver - Work with CSS, Text, Images, And Links - Incorporate Flash Movies and Other Media Authors: Joseph W. Lowery, Pages: 1112, Published: 2007
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day: In One Hour A Day Authors: Laura Lemay, Rafe Colburn, Pages: 816, Published: 2006
Struts: The Complete Reference Authors: James Holmes, Pages: 800, Published: 2006
Programming Jakarta Struts: Building Web Applications with Servlets & JSPs. Complete Coverage of 1.1 Authors: Chuck Cavaness, Pages: 470, Published: 2004
Beginning ASP.NET 3.5 in C# 2008: From Novice to Professional Authors: Matthew MacDonald, Pages: 954, Published: 2007
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005
Beginning Visual Web Programming in VB .NET: From Novice to Professional Authors: Daniel Cazzulino, Craig Bowes, Victor Garcia Aprea, Mike Clark, James Greenwood, Chris Hart, Pages: 648, Published: 2005
The Internet Encyclopedia Authors: Hossein Bidgoli, Pages: 0, Published: 2004
Professional Ruby on Rails Authors: Noel Rappin, Pages: 457, Published: 2008
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007

Web:
CSS problem in Form tag in VS - ng.asp-net-forum ... CSS problem in Form tag in VS, > ROOT > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2008, Date: 1/22/2008 3:01:59 AM, Replies: 4, Views: 13, ...
CSS problem in Form tag in VS - ASP.NET Forums CSS problem in Form tag in VS. Last post 01-21-2008 11:24 PM by prizzy. 4 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Solving layout issues created by tags | Summersault Blog Up until this point I've worked around this problem by putting the form tag ... will automatically remove any space from above and below form tags. CSS: ...
An unusual css problem with tag - Dev Shed An unusual css problem with tag- CSS Help. Visit Dev Shed to discuss An unusual css problem with tag.
[css-d] Form tags messing up Header and 3 col design I have hit a problem with some pages I am working on. All the pages are being developed in ASP.Net which favours a form tag just after the Body tag so that ...
CSS Creator [Solved] IE7 problem and two FORM tags inside divs Hi I have a CSS problem and I have been banging my head against it for ages. I just cant see how to fix it or why it is happening.
form tag gives problem with table-less css Where i use one form tag for the whole site, right after ... Hosting, DNS and Server Issues ยท form tag gives problem with table-less css ...
Problem with Opera 9.5 and asp.net form tag - SitePoint Forums Problem with Opera 9.5 and asp.net form tag CSS. ... So i really am stuck - has anyone else had this problem before? ...
The CHRIS TIERNEY ColdFusion and Flex Blog: HTML Form Tag and CSS ColdFusion, Flex and Other Matters: HTML Form Tag and CSS.
tag causing line breaks I^(1)ve tried using margin:0 and padding:0 for the form tag in my css, but >> this >> does nothing.... >> >> > > Set the form to display: inline. ...

Videos:
Web 2.0 ... The Machine is Us/ing Us Final version now available! http://youtube.com/watch?v=NLlGopyXT_g http://mediatedcultures.net Web 2.0 in just under 5 minutes. This ...
Developing JavaScript with Chickenfoot Google TechTalks July 25, 2006 Rob Miller Michael Bolin ABSTRACT Chickenfoot is a Firefox extension that embeds a JavaScript programming ...
AK vs. FACE Boxing




Search This Site:










client found response content type of '', but expected 'text/xml'

multilingual database driven site a real challenge!

unable to publish a website in visual studio 2005

can dotnetnuke support chinese

css problem with different browsers

2.0 treeview not maintaing state!

images for text/html module???

combine all of asp.net authentication types ?

best way to setup multiple websites?

logging in to external web sites

what happened to treeview.autopostback?

createuserwizard also did not prevent registering with a duplicated email

go to definition... i don't want the metadata!

password seed...

problem with connections timing in event sequence after post back

installing dnn 3 error sql server does not exist or access denied

pls help asap error with unc share problem in asp.net unable to create web project web11

web application extension packaging

letting other visitors see users personalised pages

modeless dialog in asp.net

asp.net isapi extension (aspnet_isapi.dll)

turning off autocomplete for asp tags

how to get a profilecommon in the app_code ?

very basic problem - please help!

[:p] upgrade log for version:

pagename in skins

the menu control and graphics

menu control

vwd putting data into database

access database and .net 1.1

 
All Times Are GMT