并排显示图像(display images side by side)
我试图并排显示2个箭头链接,但我得到一些CSS错误。
我的html代码如下:
<div> <a href="javascript:void(0);" id="move_down"> <span class="down_arrow"> </span> </a> <a href="javascript:void(0);" id="move_up"> <span class="up_arrow"> </span></a> </div>
CSS:
.down_arrow{ display:block; background: url(../images/down_arrow.png) no-repeat left center; } .up_arrow{ display:block; background: url(../images/up_arrow.png) no-repeat left center; }
目前,图像一个在另一个下方显示。 我希望然后并排显示。 但是如果我删除
display:block;
在css中,图像显示不正确。我也尝试删除display:block并将float:left放在两个类中,但仍然无效。
如果有人能为我提供解决方案,我将不胜感激。
非常感谢。
I am trying to display 2 arrow links side by side but am getting some css errors.
My html code is below:
<div> <a href="javascript:void(0);" id="move_down"> <span class="down_arrow"> </span> </a> <a href="javascript:void(0);" id="move_up"> <span class="up_arrow"> </span></a> </div>
CSS:
.down_arrow{ display:block; background: url(../images/down_arrow.png) no-repeat left center; } .up_arrow{ display:block; background: url(../images/up_arrow.png) no-repeat left center; }
Currently, the images are displayed one below another. I want then to be displayed side by side. However if i remove the
display:block;
in the css, the image is not displayed properly.I also tried removing the display:block and put float:left for both classes but still not working.
I would be grateful if someone could provide me with a solution.
Many many thanks.
原文:https://stackoverflow.com/questions/6253466
满意答案
此方法以递归方式将样式应用于MenuItem及其所有子项及其子项:
<MenuItem Header="Main Menu Item"> <MenuItem Header="Unaffected Sibling" /> <MenuItem Header="Foo"> <MenuItem.Resources> <Style TargetType="MenuItem"> <Setter Property="MenuItem.Header" Value="{Binding InAppName}" /> <Setter Property="IsCheckable" Value="True" /> <Setter Property="IsChecked" Value="{Binding IsSomeRandomBoolProperty}" /> <Setter Property="Background" Value="YellowGreen" /> <Setter Property="FontWeight" Value="Bold" /> <Setter Property="Foreground" Value="Red" /> </Style> </MenuItem.Resources> <MenuItem Header="Bar" /> <MenuItem Header="I Am Damo Suzuki"> <MenuItem Header="Blah blah blah"> <MenuItem Header="Amon Duul II" /> </MenuItem> </MenuItem> </MenuItem> </MenuItem>
This method applies a style to a MenuItem and all of its children, and their children, recursively:
<MenuItem Header="Main Menu Item"> <MenuItem Header="Unaffected Sibling" /> <MenuItem Header="Foo"> <MenuItem.Resources> <Style TargetType="MenuItem"> <Setter Property="MenuItem.Header" Value="{Binding InAppName}" /> <Setter Property="IsCheckable" Value="True" /> <Setter Property="IsChecked" Value="{Binding IsSomeRandomBoolProperty}" /> <Setter Property="Background" Value="YellowGreen" /> <Setter Property="FontWeight" Value="Bold" /> <Setter Property="Foreground" Value="Red" /> </Style> </MenuItem.Resources> <MenuItem Header="Bar" /> <MenuItem Header="I Am Damo Suzuki"> <MenuItem Header="Blah blah blah"> <MenuItem Header="Amon Duul II" /> </MenuItem> </MenuItem> </MenuItem> </MenuItem>
相关问答
更多相互排斥的可检查菜单项?(Mutually exclusive checkable menu items?)
QMenu中的一次QAction可以检查(One QAction checkable at time in QMenu)
如何动态添加MenuItems(带标题)到WPF菜单(How to dynamically add MenuItems (with a header) to a WPF menu)
使RelativeLayout可检查(Make RelativeLayout checkable)
Android可选菜单项(Android Checkable Menu Item)
从Collection创建MenuItems(Create MenuItems from Collection)
如何在按下时设置MenuItems工具栏的样式(How to styling MenuItems Toolbar when pressed)
将菜单项绑定到一个集合,使它们可以检查并设置样式(Bind Menuitems to a collection, make them checkable and style the)
$ menuItems中的Yii2 foreach循环(Yii2 foreach loop inside $menuItems)
删除菜单项周围的薄边框(Removing thin border around the menuitems)
相关文章
更多Riak, haproxy, and client side applications
Flex 如何输出日志
图解全文检索SOLR的酷应用[Ajax Solr]
mmseg4j相关
《C/C++图像处理编程》扫描版[PDF]
Hadoop实现数据库表关联
solr relevent project
solr relevent project
《数字图像处理与机器视觉:Visual C++与Matlab实现》扫描版[PDF]
Hadoop作业调优参数整理及原理
最新问答
更多获取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),本站将尽快处理。谢谢合作!