简体   繁体   中英

Spacing Issues With Tables And <p> (HTML and CSS)

I've got a site based around tables. Basically, I have a body area and the top of the body sits flush with the bottom of the header nav bar. Whenever I type text into the body, the body shifts down some pixels. Here are the examples:

This is before I type anything out:

这是我输入任何内容之前(如果可以看到的话,我知道那有点黑)

This is after I type text in (nevermind the colors on top, it's a fading color bar that changes colors):

这是在我输入文本后。它向下移动。

I tried to set all the margins to 0px and the padding etc. I can't seem to figure it out. I running CSS styles with the headers and body etc., I can't seem to figure out what attribute is causing this to happen. Any help would be appreciated.

我猜是(疯狂地)在进行空Td之前进行表格cellpadding。

You might try the line-height property of the text? w3schools.com

I converted this site to divs as opposed to tables. While I didn't entirely figure out what was wrong with this issue, I've learned that there are a whole host of problems with tables (as opposed to divs) especially when it comes to cross-browser compatibility.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM