0

我正在尝试制作一个围绕除标签之外的所有内容的 div<p>标签。有没有办法排除某个或某些标签?谢谢您的帮助。

我的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


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

<body>

<div id='main'>

<h1>FREE Python programs!</h1>

<h3><p>You're saying to yourself "I could use a handy little program that does this
" or "I need a better calculator than Windows has provided me!" THIS IS THE SITE YOU'VE      BEEN LOOKING FOR! Just email me at:</p></h3> 

<a href="mailto:benevedeselias@gmail.com" target="_blank">Python Program Maker</a>

<h3><p>And I'll respond as fast as I can!</p></h3>
<p>This is my portfolio of very small applications:</p>

<a href="portfolio.zip">Portfolio Download</a>

<p>If you would like to subscribe to my Python Mailing list, click on the link above to    shoot me an email. Please have the subject be "Add to mailing list". All this mailing list    would do is send you updates to my website, python programs, or portfolio. This would mean   a great lot to me if you did.</p>

<p>These links provide more information about each piece in my portfolio:</p>

<a href='CardDrawer.html'>Card Drawer</a>
<a href='BlockGame.html'>Block Game</a>
<a href='Dice.html'>Dice</a>
<a href='SecretNumber.html'>Secret Number</a>

<p>If you would like to learn python yourself, I have started a video tutorial series.     Here is the first one:</p>
<iframe width="560" height="315" src="http://www.youtube.com/embed/STe5x9V8kbk?rel=0"    frameborder="0" allowfullscreen></iframe>

</div>



</body>

</head>

我所要做的就是避免在每个 p 标签处中断多个 div 标签并在它之后重新开始。

4

2 回答 2

0

为什么你不想让 div 围绕 p 标签?

使用一个包含 p 标签的 div 标签,您应该能够在 CSS 中为所有内容设置样式

于 2012-10-13T21:29:03.330 回答
0

我真的不明白你的意思,但我可以尝试:

你可以给你的<p>标签他们自己的类和/或ID。你可以在你的css中为它创建一个类/id,这样他们就会忽略给你div的css。(我希望这就是你的意思)

所以你得到:

<p class="yourclass">text</p>

你甚至可以给他们不同的背景颜色。如果您不想将它们放在您的 div 中,只需将它们放在它之外。虽然没有太大的好处...

如果你的意思是你想用每个 div 结束,这就是你必须做的。没有办法解决它。

于 2012-10-13T21:29:28.983 回答