Page 1 of 1

Html problem in notes

Posted: Wed Jun 30, 2010 9:08 pm
by Adramalech
I made some html note, but Cantr is messing with it.
Cantr messes with the height of my table, it should fit tight around the text, but it makes huge spaces in the top and bottom.. no vertical-align, margin or padding and stuffing div's in solves it :(

ofcourse I can type for hours, but a picture says more then a thousand words, so:

Image

Also the code would help:

Code: Select all

<html>
<body>

<!--Watch out!, here comes the header!-->

<table width="810" style="border-collapse:collapse;border:none;margin:0;padding:0">
<tr height="200" background="http://i48.tinypic.com/xxxxxx.png"  style="background-repeat:no-repeat"><td></td></tr>
<tr background="http://i50.tinypic.com/iedrb4.png">
<td style="color:black;padding-left:50px">
<h1 style="text-align:center">Official Tradehouse Document</h1>
</td></tr>

<!--Naming and stuff is done in this segment-->

<tr background="http://i50.tinypic.com/iedrb4.png">
<td style="color:black;padding-left:50px">


<dl>
<dt>name</dt>
<dt>Tradehouse owner and manager</dt>
</dl>

</td></tr>

<!--Ok, formal stuff done.. Lets get down to business-->

<tr background="http://i50.tinypic.com/iedrb4.png">
<td style="color:black;padding-left:50px;vertical-align:top">
<div style="vertical-align:top;height:100%">
<!--Typing starts here, <br /> marks a new line-->

Hello,
<br />
I would like to show you a test of the new official document of the name Tradehouse, it is probably located in name , but we can change that. All we need to do is change the name in the header right? Well lets hope we can begin this soon.
<br />
Greetings, name.

<!--Typing ends here, seriously.-->
</div>
</td></tr>

<!--Ok should be all done now, I'll show the footer and we can go home!-->

<tr height="200" background="http://i47.tinypic.com/xxxxxx.png" style="background-repeat:no-repeat">
<td></td>
</tr>
</table>

</body>
</html>

Re: Html problem in notes

Posted: Wed Jun 30, 2010 11:35 pm
by joo
There's probably a CSS style somewhere on the note display page that alters the padding or something similar for TRs, TDs or DIVs. Look for linked stylesheets and ones embedded in the HTML in the form <style type="text/css">...</style>. I couldn't see anything that might cause that in cantr.css.

Also, you should use:

Code: Select all

<element style="background-image:url(http://wo.lo/lo.png)">

instead of:

Code: Select all

<element background="http://wo.lo/lo.png">

as the latter does not work consistently on all browsers.

Re: Html problem in notes

Posted: Thu Jul 01, 2010 10:40 am
by Adramalech
Ok thanks, I also checked the cantr css and couldn't find anything.
When I put stuff like margin/padding/etc. in <style type="text/css"></style> or in <body style=""></body>
It just does nothing, except for when i put something like padding:100px, then the whole page gets fucked up, but 1px does nothing again..
I also happend to notice that if I do <body style="><body> (yes the one " was on purpose)
that grabs the right padding/margin/etc, but it also fucks with some other stuff.
I also tried it as a normal webpage and then it works fine.

Re: Html problem in notes

Posted: Thu Jul 01, 2010 11:02 am
by joo
You can't put a body inside a body. Have you tried explicitly setting the padding and margin of the DIVs to zero pixels? i.e.

Code: Select all

<div style="padding:0px; margin:0px">
Wololo!
</div>

Or if that fails, try the same with the TRs and the TDs.

Re: Html problem in notes

Posted: Thu Jul 01, 2010 11:14 am
by Adramalech
I didn't put the body inside the body (duh :P) I will now make it clear:

Code: Select all

<html>
<body style="blablabla">
all the cody shit comes here
</body>
</html>


I just tried stuffing the padding and margin in the tr/td/div's and nope, it doesn't work at all.. the left and right padding/margin does work btw.

Re: Html problem in notes

Posted: Thu Jul 01, 2010 11:51 am
by EchoMan
Remove the whitespace and comments from your note. Notes are displayed in a PRE tag.

Re: Html problem in notes

Posted: Thu Jul 01, 2010 1:29 pm
by Adramalech
Ah thanks :D

I didn't remove the comments and whitespace, but I did this:

Code: Select all

<html>
<body>
</pre>
stuffing
<pre>
</body>
</html>


And it also works :)

Re: Html problem in notes

Posted: Thu Jul 01, 2010 1:51 pm
by EchoMan
Having HTML and BODY in there is not needed, and in fact breaks the DOM for the page. :)

Re: Html problem in notes

Posted: Fri Jul 02, 2010 10:07 am
by joo
o_O Oh, right, I forgot about that whitespace matter. And yes, what I meant was everything is already embedded inside the <body> tag of the containing document, so it's improper to define a new document.