http://www.gzsi.gov.cn/
各位牛人帮忙看下这个网页的布局
右侧二维码这块,可以附着在body整体的右侧,并能不随页面的上下滚动而滚动。当页面缩小时,也不会像一般的浮动窗口布局一样,出现在窗口的固定位置挡到主要内容。而依旧是在中间内容整体的右侧。如何做到网页居中而右侧这一块附着在右侧呢
回复讨论(解决方案)
absolute定位
定位..................
absolute定位
这个是根据浏览器窗口的定位吧,我要的是这个网站里面的效果呢
定位..................
就是问如何定位呢,和平时的浮动广告不太一样
假设页面总宽度1190px
那么 .right-nav 的位置,从全屏的一半宽度开始算50%, margin-left 的值是 1190/2 = 595px;
所以不管浏览器是不是最大化的,右边div都能贴在主区域的右侧
<style type="text/css">.main{width:1190px;margin:0 auto;}.box{background:#ccc;height:400px;}.right-nav{display:block;position:fixed;top:0;left:50%;margin-left:595px;background:#fcc;width:100px;height:300px;}</style><div class="main box"></div><div class="right-nav"></div>
看下面的代码:
.floatLeft{position: fixed;left: 50%;top: 50%;margin: -50px 0 0 -650px;font-size: 12px;display: none;}
这是浮动在左边的。。。。。跟楼上差不多,主要还是position: fixed,加上left百分比,再加上margin,就可以做成你想要的效果了。
absolute定位
这个是根据浏览器窗口的定位吧,我要的是这个网站里面的效果呢
如果不想用fixed的话,可以把挨着广告,也就是广告左边部分的div设置relative属性,然后再直接给广告加absolute属性就可以了
absolute定位
这个是根据浏览器窗口的定位吧,我要的是这个网站里面的效果呢
如果你想滚动页面而二维码这块不动,那么直接fixed就OK了

The official account web page update cache, this thing is simple and simple, and it is complicated enough to drink a pot of it. You worked hard to update the official account article, but the user still opened the old version. Who can bear the taste? In this article, let’s take a look at the twists and turns behind this and how to solve this problem gracefully. After reading it, you can easily deal with various caching problems, allowing your users to always experience the freshest content. Let’s talk about the basics first. To put it bluntly, in order to improve access speed, the browser or server stores some static resources (such as pictures, CSS, JS) or page content. Next time you access it, you can directly retrieve it from the cache without having to download it again, and it is naturally fast. But this thing is also a double-edged sword. The new version is online,

This article demonstrates efficient PNG border addition to webpages using CSS. It argues that CSS offers superior performance compared to JavaScript or libraries, detailing how to adjust border width, style, and color for subtle or prominent effect

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version
