我找不到使布局居中并保持视频 div 完整的方法。每当我使用自动左右边距将其居中时,当我调整窗口大小时,div 会遍布整个地方。
有没有解决的办法?
我找不到使布局居中并保持视频 div 完整的方法。每当我使用自动左右边距将其居中时,当我调整窗口大小时,div 会遍布整个地方。
有没有解决的办法?
For starters, there's no need to declare two seperate CSS <style>
tags. Compile them into one or even better, call your css from an external file. Next, there's a <div id="wrap">
in the <head></head>
section with no closing tag. Keep your content in the body and make sure to close them up.
As for your layout itself, this should be fairly straightforward coding considering you're using a single image for the entire page. Position your image as desired and then position your video div in place with just your top:
and left
tags. There's no need to declare your margins, honestly. You're using absolute positioning.
Also, you should declare your main
wrapper first for the sake of cleanliness. There's several more ways to do a site using your method (and much cleaner ones mind you), but start with this and work through it. If you need more information (for external stylesheets or the like), you can ask here, but Google is your friend.