vids:xvid解码器

Positioning elements on a web page can seem maddeningly difficult at times, especially given all the various methods available. And the options continue to expand, with the introduction of flexbox and grid layouts, as well as cool things like CSS3 transforms, which can also be used for amazing layout tricks.

有时,在网页上定位元素似乎非常困难,特别是考虑到所有可用的方法。 随着flexbox和网格布局的引入,以及CSS3转换之类的酷功能,这些选项也在不断扩展,这些布局也可以用于惊人的布局技巧 。

In this forum dCode, CSS expert Paul O’Brien answers anything and everything about the tricky subject of CSS positioning — from floats and relative, absolute and fixed positioning to table display and even flexbox.

在这个dCode论坛中,CSS专家Paul O'Brien回答了有关CSS定位棘手主题的所有问题,包括浮点数和相对,绝对和固定位置到表格显示,甚至是flexbox。

If you have any questions about CSS positioning, please join the conversation!

如果您对CSS定位有任何疑问, 请加入对话 !

关于dCode (About dCodes)

Our Forum dCodes are topics that feature a guest who conducts a deep dive into a subject area. Unlike our Q&A sessions, which run for just an hour, dCode topics stay open over a long period, so that issues can be discussed at greater length and in greater depth. You can ask questions, or just sit back and follow along, over time, as the guest answers questions and posts content of interest.

我们的论坛dCode的主题是邀请来宾深入探讨主题领域的主题。 与我们的问答环节 (仅运行一个小时)不同,dCode主题可以长期开放,因此可以更长时间,更深入地讨论问题。 随着时间的流逝,客人可以提出问题,或者只是坐下来跟着,随着客人回答问题并发布感兴趣的内容。

关于保罗 (About Paul)

Paul O’Brien is a widely recognized expert in all things CSS. He co-authored the landmark tome The Ultimate CSS Reference, and for many years has been a guiding light for many a developer wandering through the dark forests of CSS.

Paul O'Brien是所有CSS领域的公认专家。 他与他人共同撰写了具有里程碑意义的巨著《 The Ultimate CSS Reference》 ,多年来一直是许多开发人员在CSS的黑暗森林中徘徊的指南。

Have you heard of containing floats with overflow: hidden or similar? It was Paul who unearthed that technique back in the day.

您是否听说过包含overflow: hiddenoverflow: hidden浮标? 保罗是那个时候发掘这项技术的人 。

If something can be done in CSS, Paul will know how to do it. He even regularly points out how to do things people thought weren’t even possible.

如果可以在CSS中完成某些工作,Paul将知道如何做。 他甚至定期指出人们认为不可能做的事情 。

保罗的主题入门 (Paul’s Topic Starter)

To start the thread off, Paul has created a small demo that simply places a small 50px fixed width and height red box to the right of the page. The html is basically as follows:

为了开始讨论,Paul创建了一个小示例,仅在页面右侧放置了一个小50px固定宽度和高度的红色框。 html基本上如下:

<div class="wrap">
<div class="box">Box</div>
</div>

Before you look at the demo take some time and see how many ways you can think of doing this?

在观看演示之前,需要花一些时间,看看可以想到多少种方法?

You may immediately think of about 3 ways to do this but as you delve into the details you find that there are in fact many ways to do this and in the demo I stopped at 15 but I wouldn’t be surprised to see quite a few ways I hadn’t thought of cropping up!

您可能会立即想到执行此操作的大约3种方法,但是在深入研究细节时,您发现实际上有很多方法可以执行此操作,在演示中,我停在15点,但是看到如此多的示例我不会感到惊讶我没想到突然冒出来的方法!

Here’s my demo and see if you can come up with other ways to do this:

这是我的演示,看看您是否可以提出其他方法来做到这一点:

See the Pen Box to the right by Paul O’Brien (@paulobrien) on CodePen.

见笔右侧框中由保罗·奥布莱恩( @paulobrien上) CodePen 。

The point of the exercise was simply to show that in CSS there are often many ways that a layout can be achieved and often the solution depends on what comes next as to what method is best to use. I often say that “the beauty of CSS is that there are many ways to do the same thing” but the difficulty for beginners is knowing which is the right way for the job in hand.

练习的目的只是说明CSS中通常可以通过多种方法来实现布局,并且解决方案通常取决于接下来要使用哪种方法。 我经常说“ CSS的美在于有很多方法可以做相同的事情”,但是对于初学者来说,困难在于要知道哪种方法才是正确的方法。

Now that you have looked at the demo (be honest here) how many of you thought of or understood the very first method in the demo?

既然您已经查看了该演示(在这里很诚实),您中有多少人想到或理解了演示中的第一种方法?

This was the simplest and most basic answer and probably one of the first lessons learned and forgotten by most people and I will guess that few of you will have thought of it.

这是最简单,最基本的答案,可能是大多数人学到和忘记的第一课,我想你们当中很少有人会想到它。

.box {margin:0 0 0 auto; width:50px; height:50px;background:red;}

It looks simple enough but how does that put a box to the right of the page?

它看起来很简单,但是如何在页面右侧放置一个框?

We are all familiar with margin:0 auto which will center block elements horizontally but how does margin:0 0 0 auto; move a box to the right?

我们都熟悉margin:0 auto ,它将水平放置块元素居中,但是margin:0 0 0 auto; 向右移动一个框?

To answer this you need to refer to the specifications but a simplified example is that the width + padding + margins = width of the containing block.

要回答这个问题,您需要参考规范,但一个简化的示例是宽度+填充+边距=包含块的宽度。

Therefore, for a fixed width element that has a right margin of zero then the left margin must equal the distance left to the left edge of the containing block. This is achieved with a margin-left of auto.

因此,对于右边距为零的固定宽度元素,则左边距必须等于到包含块的左边缘的距离。 这是通过automargin-left的。

If instead you put a margin-left of zero then the box moves to the left side and in ltr languages the margin-right zero would then equate to auto (even if you specify zero) in order for the requirements of the box model to hold true.

相反,如果您将margin-left设置为零,那么该框将移至左侧,而在ltr语言中,margin-right零将等于auto(即使您指定了零),以便满足box模型的要求真正。

lastly if you put a margin-left and margin-right of auto then the box becomes centered as we all know and love.

最后,如果您将auto设置为margin-leftmargin-right ,则该框将居中,我们都知道并喜欢。

(I have simplified the answer so read the specs for full details and understanding.)

(我已经简化了答案,因此请阅读规格以获得完整的细节和理解。)

I mention this auto margin technique because it is a prominent technique when using flexbox and an auto margin on a flex-item will move that element to the edge of the box (whether that be left , right up or down). Incidentally it is not well known that margin:auto on an absolutely positioned element will center the element both horizontally and vertically within a fixed height and width container.

我提到了这种自动页边距技术,因为它是使用flexbox时的一项突出技术,并且在flex-item上的自动页边距会将该元素移到框的边缘(无论是向左,向右或向上或向下)。 偶然地,在绝对定位的元素上的margin:auto会在固定的高度和宽度容器内将元素水平和垂直居中并不为人所知。

That’s enough about margins anyway and have a look through the rest of the examples in the first demo and if you can think of more ways to do this then feel free to post or discuss.

无论如何,这足以满足边距的需求,并浏览第一个演示中的其余示例,如果您能想到更多实现此目的的方法,请随时发布或讨论。

If you don’t understand any of the examples then please discuss and we can clarify.

如果您不理解任何示例,请进行讨论,我们可以进行澄清。

Note that this thread isn’t simply about this first post but mainly as a talking point to keep things moving so if you have topics you wish to discuss then please go ahead.

请注意,该主题不仅是关于此第一篇文章的,而且主要是为了使事情发展而成为一个谈话要点,因此,如果您有想要讨论的主题,请继续。

I look forward to answering or being baffled by your queries. I can’t guarantee to know all the answers but I’m sure if I don’t know the answer someone else will have a good idea and chip in to the conversation.

我期待着回答或为您的查询所困扰。 我不能保证知道所有答案,但是我敢肯定,如果我不知道答案,其他人将有一个好主意并参与到对话中。

Follow this discussion further in the SitePoint forums.

在SitePoint论坛中进一步关注此讨论 。

翻译自: https://www.sitepoint.com/decoding-css-positioning/

vids:xvid解码器

vids:xvid解码器_解码CSS位置:Paul O'Brien的大师班相关推荐

  1. wmp使用第三方解码器_解码Eclipse IP策略:第三方依赖性

    wmp使用第三方解码器 知识产权 (IP)一词是指任何形式的创意作品,无论是文学,艺术还是软件. 在开源软件领域,诸如源代码,文档和图像之类的工件被视为知识产权. 除非另有说明,否则知识产权是其创造者 ...

  2. css左右布局代码_如何使用CSS位置来布局网站(带有示例代码)

    css左右布局代码 Using CSS position to layout elements on your website can be hard to figure out. What's th ...

  3. 肯德基圣代中间空心_建造冰淇淋圣代解释CSS位置

    肯德基圣代中间空心 by Kevin Kononenko 凯文·科诺年科(Kevin Kononenko) 建造冰淇淋圣代解释CSS位置 (CSS Positioning Explained By B ...

  4. VBA小程序--针对所有已经打开的Excel文件_格式调整_针对所有工作表_冻结首行_无视所在位置

    VBA小程序--针对所有已经打开的Excel文件_格式调整_针对所有工作表_冻结首行_无视所在位置 Function 格式调整_针对所有工作表_冻结首行_无视所在位置()Dim sht As Work ...

  5. html怎么做一条轴,html实现时间轴_纯css实现响应式竖着/垂直时间抽布局效果

    1.概述 html实现用时间点来展示事件发生点来代替用table展示一条条数据,能够给人清晰.一目了然能够看清事情发生的过程,UI页面也显示的那么清晰.如何用css+html做出时间轴展示事件点的?先 ...

  6. 接口调用简单、多平台支持的RTSP-Server组件EasyRTSPServer如何修正多网卡多IP情况下解码器不能解码显示问题

    EasyRTSPServer修正多网卡多IP情况下解码器不能解码显示问题 提出问题: 海康NVR接入正常,但接入海康解码器出不来图像. 分析问题: 海康解码器是以rtp over udp的方式进行取流 ...

  7. css动画 和 js动画_CSS大师的动画建议

    css动画 和 js动画 Just over a week ago we were lucky enough to have Tiffany Brown join us on the SitePoin ...

  8. 外链式样式表_引入CSS样式表(书写位置)

    CSS初识 CSS(Cascading Style Sheets) 美化样式 CSS通常称为CSS样式表或层叠样式表(级联样式表),主要用于设置HTML页面中的文本内容(字体.大小.对齐方式等).图片 ...

  9. python分析出nba球员的位置_解码NBA:数据分析揭示十三个隐藏的球员位置

    自打1891年詹姆斯·奈史密斯(JAMES A. NAISMITH)发明篮球以来,篮球场上的球员就一直按照五个位置划分:中锋,大前锋.小前锋.组织后卫和得分后卫.但是斯坦福大学的一位数据狂人Muthu ...

最新文章

  1. 基础练习 龟兔赛跑预测
  2. 正则表达式匹配换行符
  3. 程序员面试的一些心得
  4. 蚂蚁金服张洁:基于深度学习的支付宝人脸识别技术解秘-1
  5. 外伤导致色觉异常型复视(球后视神经炎+视神经萎缩)
  6. 真正的maven私服搭建器--Artifactory
  7. sql性能优化之多表联查
  8. 提高个人执行力的途径
  9. 在CentOS7上安装和使用ZooKeeper最新版本(V3.4.12)
  10. CSS3新特性(阴影、动画、渐变、变形、伪元素等) CSS3与页面布局学习总结——CSS3新特性(阴影、动画、渐变、变形、伪元素等)...
  11. par函数的bg参数-控制图片的背景色
  12. php pdf打印横向,如何将pdfFactory打印调整为横向 - 应用技巧 - 常青藤软件工作室...
  13. 企业篇之员工工资管理系统(Java+SQL sever实现)
  14. 傲梅分区助手克隆Linux硬盘,傲梅分区助手复制磁盘或克隆磁盘到另外磁盘
  15. 什么叫做云计算?云计算基础学习路线
  16. Java华氏度与摄氏度之间的转换
  17. 你一定要知道长痘痘的注意点!!!
  18. 数字IC秋招手撕代码(二)50%占空比的三分频
  19. 贝宝年报解读:是谁贷走了4.3亿美元?
  20. 零失误绕制无线充电线圈

热门文章

  1. 三国志战略版:我去虎牢探探路_兴师伐乱剧本前瞻三
  2. 爬取抖音品牌热DOU榜数据
  3. ***技巧(转载暗组)
  4. OpenEuler华为欧拉系统安装教程及联网配置
  5. Linux安装和使用FTP服务Serv-U
  6. 危险!全球未打补丁的 VMware ESXi 服务器被勒索组织盯上了
  7. ioctl 详解,以ethtool为例
  8. 随 Linux 自由驰骋
  9. 北邮计算机考研拟录取名单,北京邮电大学发布拟录取名单,390分被刷,多人放弃录取名额!...
  10. 英文字体展示(18号字体大小)