Can't change height/width of <div>

Tatorinho

New Member
I'm learning HTML/CSS and decided to try this:\[code\]<p>A paragraph with no margins specified.</p><div style="width=300px; height=300px; background-color:yellow;><p>This paragraph is in a divider.</p></div><p>A paragraph with no margins specified.</p>\[/code\]After some googling, I found that you can't change width/height for inline elements. So I tried making both the \[code\]<div>\[/code\] and \[code\]<p>\[/code\] into block elements using \[code\]display:block\[/code\], but that didn't change anything. The width goes on infinitely off-screen, and the height is only as high as the \[code\]<p>\[/code\] is. I want there to be a \[code\]<p>\[/code\] in a 300x300 \[code\]<div>\[/code\], so how can I do this? Also, why doesn't any of these ways work (even when I change to \[code\]display:block\[/code\])?Thanks.
Also, I know you shouldn't use excessive CSS like I did. This is only because I was testing stuff with W3's "Try-It-Yourself" HTML editor.
 
Back
Top