国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Web Front-end HTML Tutorial CSS adaptive layout (left and right fixed, middle adaptive or right fixed, left adaptive)_html/css_WEB-ITnose

CSS adaptive layout (left and right fixed, middle adaptive or right fixed, left adaptive)_html/css_WEB-ITnose

Jun 24, 2016 pm 12:03 PM
Right fixed left side layout Adaptive

經(jīng)常在工作中或者在面試中會碰到這樣的問題,比如我想要個布局?側(cè)固定寬度 左側(cè)自適應(yīng)?或者?三列布局 左右固定 中間自適應(yīng)的問題。

???? 下面我們分別來學(xué)習(xí)下,當(dāng)然我也是總結(jié)下而已,有如以下網(wǎng)站源碼方法:

?????一:?右側(cè)固定寬度 左側(cè)自適應(yīng)

 ?第一種方法:左側(cè)用margin-right,右側(cè)float:right? 就可以實(shí)現(xiàn)。

????HTML代碼可以如下寫:
?? ?


?? ??? ?我是龍恩
?? ?

 


?? ??? ?我是龍恩
?? ?

  CSS代碼可以如下寫:

??? .box-left{height:300px;margin-right:300px;background:#DDD;}
??? .box-right{width:300px;height:300px;float:right;background:#AAA;}

??? 如上代碼就可以實(shí)現(xiàn)效果。

????第2種方法:左側(cè)同樣用margin-right? 右側(cè)采用絕對定位 如下代碼所示:

??? HTML代碼如下:

???


?? ??? ?

?? ??? ??? ?我是龍恩
?? ??? ?

?? ??? ?

?? ??? ??? ?我是龍恩
?? ??? ?

?? ?

?CSS代碼如下:

?.bd{position:relative;}
?.bd-left{height:300px;;margin-right:300px;background:#DDD;}
?.bd-right{width:300px;height:300px;position:absolute;top:0;right:0;background:#AAA;}

?第三種方法:右側(cè)浮動 且 用負(fù)margin值

?HTML代碼如下:

?


?? ??? ?

?? ??? ??? ?

?? ??? ??? ??? ?我是龍恩
?? ??? ??? ?

?? ??? ?

?? ??? ?

?? ??? ??? ?我是龍恩
?? ??? ?

?? ?

? CSS代碼如下:

? .wrap{overflow:hidden;background:#EEE;}
? .wrap-right{width:300px;position:relative;float:right;margin-left:-300px;background:#AAA;}
? .wrap-left{width:100%;float:left;}
? .left-con{margin-right:300px;background:#DDD;}
? .left-con,.wrap-right{height:300px;}

以上是我總結(jié)的三種html css 兩列布局方法(左側(cè)自適應(yīng) 右側(cè)固定),如有不足的地方 請大家多多指教。下面我們來看看三列布局(左右固定 中間自適應(yīng)的情況)。

?二:左右固定 中間自適應(yīng)的情況

?我目前總結(jié)了2種方法 如下:

?第一種:左右側(cè)采用浮動 中間采用margin-left 和 margin-right 方法。

?代碼如下:

???

?
?? ???
這是右側(cè)的內(nèi)容 固定寬度

?
This is the fixed width of the content on the left

?
Middle content, adaptive width

Second type: The left and right sides use absolute positioning, and the middle also uses the margin-left margin-right method:

The HTML code is as follows:

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Windows 11: The easy way to import and export start layouts Windows 11: The easy way to import and export start layouts Aug 22, 2023 am 10:13 AM

In Windows 11, the Start menu has been redesigned and features a simplified set of apps arranged in a grid of pages, unlike its predecessor, which had folders, apps, and apps on the Start menu. Group. You can customize the Start menu layout and import and export it to other Windows devices to personalize it to your liking. In this guide, we’ll discuss step-by-step instructions for importing Start Layout to customize the default layout on Windows 11. What is Import-StartLayout in Windows 11? Import Start Layout is a cmdlet used in Windows 10 and earlier versions to import customizations for the Start menu into

Convert VirtualBox fixed disk to dynamic disk and vice versa Convert VirtualBox fixed disk to dynamic disk and vice versa Mar 25, 2024 am 09:36 AM

When creating a virtual machine, you will be asked to select a disk type, you can select fixed disk or dynamic disk. What if you choose fixed disks and later realize you need dynamic disks, or vice versa? Good! You can convert one to the other. In this post, we will see how to convert VirtualBox fixed disk to dynamic disk and vice versa. A dynamic disk is a virtual hard disk that initially has a small size and grows in size as you store data in the virtual machine. Dynamic disks are very efficient at saving storage space because they only take up as much host storage space as needed. However, as disk capacity expands, your computer's performance may be slightly affected. Fixed disks and dynamic disks are commonly used in virtual machines

How to save desktop icon position layout in Windows 11 How to save desktop icon position layout in Windows 11 Aug 23, 2023 pm 09:53 PM

Windows 11 brings a lot to the table in terms of user experience, but the iteration isn't entirely error-proof. Users run into issues from time to time, and changes to icon positioning are common. So how to save desktop layout in Windows 11? There are built-in and third-party solutions for this task, whether it's saving the screen resolution of the current window or the arrangement of desktop icons. This becomes even more important for users who have a bunch of icons on their desktop. Read on to learn how to save desktop icon locations in Windows 11. Why doesn't Windows 11 save icon layout positions? Here are the main reasons why Windows 11 does not save desktop icon layout: Changes to display settings: Typically, when you modify display settings, the configured customizations

How to set a computer lock screen wallpaper that will not change How to set a computer lock screen wallpaper that will not change Jan 17, 2024 pm 03:24 PM

Generally speaking, the desktop background pattern of a computer can be adjusted by the user. However, for some Windows 10 users, they want to be able to fix the desktop background image on their computer, but they don’t know how to set it. In fact, it is very simple and easy to operate. How to fix the computer lock screen wallpaper without changing it 1. Right-click the picture you want to set and select Set as background picture 2. Win+R to open and run, then enter "gpedit.msc" 3. Expand to: User Configuration - Management Templates - Control Panel - Personalization 4. Click Personalization, and then select "Prevent changes to desktop background" 5. Select Enabled 6. Then open settings and enter the background. When you see these small words, it means that it has been set up.

How to keep the widgets panel always visible in Windows 11 How to keep the widgets panel always visible in Windows 11 Aug 13, 2023 pm 07:13 PM

How to always show widget board when opening in Windows 11? Well, you can start by downloading and installing the latest Windows updates. In the latest update patch for the Insider Program, Microsoft revealed that users in the Development and Canary channels will be able to pin the widget board open so it is always visible at a glance. How to Always Show Widgets Board Open in Windows 11 According to Microsoft, to pin a board to open, just click on the pushpin icon in the upper right corner of the board. Once your board is pinned open, the widget board will no longer ignore closing. While the board is pinned, you can still close it by opening the widget board via the Widgets button on the taskbar. when widget

Guide to solving misalignment of WordPress web pages Guide to solving misalignment of WordPress web pages Mar 05, 2024 pm 01:12 PM

Guide to solving misaligned WordPress web pages In WordPress website development, sometimes we encounter web page elements that are misaligned. This may be due to screen sizes on different devices, browser compatibility, or improper CSS style settings. To solve this misalignment, we need to carefully analyze the problem, find possible causes, and debug and repair it step by step. This article will share some common WordPress web page misalignment problems and corresponding solutions, and provide specific code examples to help develop

What should I do if the Win7 taskbar is displayed in the right window of the desktop? What should I do if the Win7 taskbar is displayed in the right window of the desktop? Jun 29, 2023 pm 07:41 PM

What should I do if the Win7 taskbar is displayed in the window on the right side of the desktop? Under normal circumstances, the taskbar is at the bottom of the screen by default, but recently some Win7 users found that the taskbar has moved to the right window of the screen when they turned on the computer. So is there any way to change it back? Many friends don’t know how to operate in detail. The editor below has compiled the steps to solve the problem of the Win7 taskbar displaying in the window on the right side of the desktop. If you are interested, follow the editor to take a look below! Win7 taskbar is displayed in the window on the right side of the desktop. Solution steps 1. First, we right-click the taskbar in the window on the right side of the desktop and select Properties, as shown in the figure below: 2. In the opened taskbar and properties window, click on the taskbar on the screen Select the bottom location, check Lock taskbar, and click

Introducing the window arrangement method in win7 Introducing the window arrangement method in win7 Dec 26, 2023 pm 04:37 PM

When we open multiple windows at the same time, win7 has the function of arranging multiple windows in different ways and then displaying them at the same time, which allows us to view the contents of each window more clearly. So how many window arrangements are there in win7? What do they look like? Let’s take a look with the editor. There are several ways to arrange Windows 7 windows: three, namely cascading windows, stacked display windows and side-by-side display windows. When we open multiple windows, we can right-click on an empty space on the taskbar. You can see three window arrangements. 1. Cascading windows: 2. Stacked display windows: 3. Display windows side by side:

See all articles