并排问题(Div side by side issue)
我的CSS有问题 - 我有两个div - “section1”和“section2”。 我希望它们并排显示,但它们正如图所示显示。 有谁知道如何并排显示它们?
<div id="section1"> <h1><London></h1> <p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants</p> </div> <div id="section2"> <h2><London></h2> <p1>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants</p> </div> </div> #section1 { float:center; padding:5px; background-color:lime; margin-left:20px; width:300px; } #section2 { float:right; background-color:lime; margin-left:10px; width:300px; }
I have an issue with my CSS - I am have two divs - "section1" and "section2". I want them to be displayed side by side but they are being displayed as seen in the picture. Does anyone know how to display them side by side?
<div id="section1"> <h1><London></h1> <p>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants</p> </div> <div id="section2"> <h2><London></h2> <p1>London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants</p> </div> </div> #section1 { float:center; padding:5px; background-color:lime; margin-left:20px; width:300px; } #section2 { float:right; background-color:lime; margin-left:10px; width:300px; }
原文:https://stackoverflow.com/questions/35977486
满意答案
Google最近宣布设计支持库 ,并且它支持实施Collapsing Toolbar 。
除了固定视图外,您还可以使用
app:layout_collapseMode="parallax"
(以及可选的app:layout_collapseParallaxMultiplier="0.7"
来设置视差乘数),以实现视差滚动(在CollapsingToolbarLayout
中表示同级ImageView)例:
<android.support.design.widget.AppBarLayout android:layout_height="192dp" android:layout_width="match_parent"> <android.support.design.widget.CollapsingToolbarLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar android:layout_height="?attr/actionBarSize" android:layout_width="match_parent" app:layout_collapseMode="pin"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout>
Google has recently announced Design support library and with this it has support for implementing Collapsing Toolbar.
In addition to pinning a view, you can use
app:layout_collapseMode="parallax"
(and optionallyapp:layout_collapseParallaxMultiplier="0.7"
to set the parallax multiplier) to implement parallax scrolling (say of a sibling ImageView within theCollapsingToolbarLayout
)Example:
<android.support.design.widget.AppBarLayout android:layout_height="192dp" android:layout_width="match_parent"> <android.support.design.widget.CollapsingToolbarLayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <android.support.v7.widget.Toolbar android:layout_height="?attr/actionBarSize" android:layout_width="match_parent" app:layout_collapseMode="pin"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout>
相关问答
更多如何做新的PlayStore视差效果(How to do the new PlayStore parallax effect)
纯CSS视差效果问题(Pure CSS Parallax effect issue)
在Materialise.css中获取视差效果需要任何特殊图像吗?(Do you need any special image for getting Parallax effect in Materialize.css?)
自举网格中的视差效果(Parallax effect within bootstrap grid)
CSS转换的视差效果(Parallax effect with CSS transition)
使用recyclerView的视差效果(Parallax effect with recyclerView)
视差效果不会起作用(Parallax effect wont work)
文本的视差效应(Parallax Effect on Text)
iPad和视差效果(iPad and parallax effect)
具有视差效果的图像尺寸问题(Image size issue with parallax effect)
相关文章
更多Riak, haproxy, and client side applications
gwt 部署在div 中的问题。
div 与 iframe页面缩小问题 [JavaScript]
如何用正则表达示匹配一个div标签
div布局代替frame布局后该如何跳转呢?
jquery 效果实现,div失去焦点
《DIV.CSS应用视频教程》(DIV+CSS)[压缩包]
Flex 如何输出日志
解决点击没有内容的空白div没有响应click事件的方法
html中一个div的id是“1:222”的话,怎么利用id给它定义css啊?
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!