我想在网页的视口周围有一个 8px 的纯黑色边框。它不滚动,内容从它的“后面”滚动。它是透明的。如果我使用具有大 z-index 的固定 div,它将阻止与其下的元素进行交互。
我怎样才能做到这一点?我可以制作 4 个 div,每边一个,左右宽度为 8px,顶部和底部高度为 8px,但这似乎是解决这个问题的糟糕方法。
谢谢你。
我有一个带有蓝色边框的 div。这个 div 是页脚,所以它被放置在页面的底部。该 div 内的文本显示在底部,但边框本身显示在顶部。
这是 HTML:
<body>
<div id="header">
this is the header
</div>
<div id="mainleft">
this is the main left
</div>
<div id="mainright">
this is the main right
</div>
<div id="footer">
this is the footer
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
这是CSS:
body{
background-color:#666666;
}
#header{
min-height:75px;
border:3px solid #000099;
}
#mainleft{
height:500px;
width:15%;
border-left:3px solid #000099;
float:left;
}
#mainright{
height:500px;
width:84%;
border-left:3px solid #000099;
border-right:3px solid #000099;
float:right;
}
#footer{
height:70px;
width:100%;
border:3px solid #098099;
bottom:0px;
}
Run Code Online (Sandbox Code Playgroud) 应该相当简单,但我迷路了,所有搜索都会产生与我的问题没有直接关系的非特定答案。
按钮,边框是黑色的,但显然,“压抑”的感觉是通过将边框颜色更改为黑色来实现的,因此当我单击按钮时,感觉“死了”。什么也没有发生,因此很难判断您是否未点击或发生了什么。
如何更改“onclick”边框颜色?这样,它可以再次获得“沮丧”的外观。
.addButton {
border-color:black;
border-width:1px;
background-color:#00B0F0;
text-decoration:underline;
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试从 Excel VBA 设置单词表的边框。许多网站建议如下:
wrdTable.Borders(wdBorderTop).LineStyle = wdLineStyleSingle
Run Code Online (Sandbox Code Playgroud)
但是在尝试时出现错误(集合的请求成员不存在)。但是,我可以使用以下代码带内边框:
wrdTable.Borders(xlDiagonalUp).LineStyle = xlContinuous
Run Code Online (Sandbox Code Playgroud)
同样我试过:
wrdTable.Borders(xlEdgeTop).LineStyle = xlContinuous
Run Code Online (Sandbox Code Playgroud)
带上边框,但我得到对角线。如何在我的单词表中应用边框(内边框和外边框)?我正在使用 Office 2007。
我有一个1-pixel-border 和height:29%的div。出于某种原因,Chrome 渲染它没有底部边框。
此问题取决于实际百分比值和容器大小;当我更改它们时,边框有时会出现有时会消失。Chrome 渲染引擎在计算实际div的高度时似乎存在一些舍入错误。此外,仅当为该div指定了溢出和位置时才会发生。
这是一个已知的错误,也许存在一些解决方法?当然,我可以通过手动重新计算高度并使用 JS 设置来摆脱该百分比值,但这不是很优雅的解决方案。
我必须在 WPF 中更改文本框的粗细,但我不知道如何仅更改一个边框。
我该怎么做?
这是我的代码
<TextBox HorizontalAlignment="Left" Height="23" Margin="215,144,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
Run Code Online (Sandbox Code Playgroud) 我使用 iTextSharp(在 SharePoint 上,但我希望这无关紧要)将 HTML 文档转换为 PDF。到目前为止,我无法在元素周围获得任何边框。我该怎么做呢?这不支持吗?
我尝试过的事情:
// in c# code
StyleSheet styles = new iTextSharp.text.html.simpleparser.StyleSheet();
styles.LoadStyle("borderCls", "border-style", "solid"); // <td class="borderCls">
styles.LoadStyle("borderCls", "border-width", "1px");
styles.LoadStyle("borderCls", "border-color", "#000");
//
styles.LoadStyle("borderCls", "border", "solid 1px #000");
// in html
<td style="border:solid 1px #000">
//
<td border="1">
//
<td style="border-style:solid;border-width:1px">
Run Code Online (Sandbox Code Playgroud)
但这些都不起作用。我只是无法让 iTextSharp 创建任何边框。
更新:也可以只在特定的一侧定义一个边框吗?
我不明白为什么caseButtonBarRow2 div宽度呈现为297.778px.它应该是300px,对吗?我想这是我的border: 1px #FF2F2A solid;.这似乎是以1.111px的大小呈现....但为什么呢?这是容器中的几个div级别,固定宽度为310px(左/右填充为5px).顶级div是唯一具有固定宽度的div,所以我猜 caseButtonBarRow2应该延伸到300px,对吗?
HTML:
<div id="caseButtonBarRow2" class="buttonBarRow">
<div style="position: relative;">
<a id="MainContent_Case7CheckBox_ToggleButton" href="" title="UNSELECTED" style="position: absolute; left: 0px; top: 0px; width: 40px; height: 40px; font-size: 40px; background-image: url(https://jimasta-laptop/ExaminerGradeSheet/images/ExaminerButton7_unchecked.png); background-repeat: no-repeat;"></a>
</div>
<input data-act-togglebuttonextender="imageWidth:40,imageHeight:40,uncheckedImageUrl:'images/ExaminerButton7_unchecked.png',checkedImageUrl:'images/ExaminerButton_checked.png',uncheckedImageAlternateText:'UNSELECTED',checkedImageAlternateText:'Case 7',id:'MainContent_ctl230'" id="MainContent_Case7CheckBox" type="checkbox" name="ctl00$MainContent$Case7CheckBox" style="visibility: hidden;">
<div style="position: relative;"><a id="MainContent_Case8CheckBox_ToggleButton" href="" title="UNSELECTED" style="position: absolute; left: 0px; top: 0px; width: 40px; height: 40px; font-size: 40px; background-image: url(https://jimasta-laptop/ExaminerGradeSheet/images/ExaminerButton8_unchecked.png); background-repeat: no-repeat;">
</a>
</div>
<input data-act-togglebuttonextender="imageWidth:40,imageHeight:40,uncheckedImageUrl:'images/ExaminerButton8_unchecked.png',checkedImageUrl:'images/ExaminerButton_checked.png',uncheckedImageAlternateText:'UNSELECTED',checkedImageAlternateText:'Case 8',id:'MainContent_ctl232'" id="MainContent_Case8CheckBox" type="checkbox" name="ctl00$MainContent$Case8CheckBox" style="visibility: hidden;">
<div …Run Code Online (Sandbox Code Playgroud) 我是CSS和HTML的新手,我想创建一个在悬停时快速放大的图像.但是盒子半径也会放大.我知道我的div课程出了问题,但我无法弄明白究竟是什么.
所以我的意思是我想要这样的效果:http: //designshack.net/tutorialexamples/imagehovers/zoomandpan.html (金发女郎一个)
这是相关代码:
#circle {
border: 4px solid;
height:200px;
width:200px;
border-color: #000;
border-radius: 100px;
}
.bolimg{
background: url('http://i60.tinypic.com/wb82e0.jpg') no-repeat;
height:200px;
width:200px;
-webkit-border-radius: 100px;
-webkit-transition: 2s ease-out;
-moz-transition: 2s ease-out;
-o-transition: 2s ease-out;
-ms-transition: 2s ease-out;
transition: 2s ease-out;
}
.bolimg:hover {
opacity:1;
background-image: url('http://i59.tinypic.com/k0szuv.jpg');
-webkit-transition: 2.5s ease-out;
-moz-transition: 2.5s ease-out;
-o-transition: 2.5s ease-out;
-ms-transition: 2.5s ease-out;
transition: 2.5s ease-out;
-webkit-transform:scale(1.25); /* Safari and Chrome */
-moz-transform:scale(1.25); /* Firefox */
-ms-transform:scale(1.25); /* IE 9 */
-o-transform:scale(1.25); /* …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我设置EditText了边框背景颜色,它在所有设备上都能正常工作,但在我的4.1.2设备上整个EditText显示为黑色.我可以在其中输入文字,一切正常,但文字不可见,因为它EditText是完全黑色的.如果我删除背景边框颜色,它工作正常.
这是我的edittext的xml代码.
<EditText
android:id="@+id/et_date_from"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.68"
android:background="@drawable/edittext_border"
android:ems="10" />
Run Code Online (Sandbox Code Playgroud)
edittext_border.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:thickness="0dp" >
<stroke
android:width="1dp"
android:color="@color/test_blue_light" />
<corners android:radius="5dp" />
</shape>
Run Code Online (Sandbox Code Playgroud)
请给我任何解决方案.
border ×10
css ×5
html ×5
c# ×2
android ×1
buttonclick ×1
colors ×1
excel ×1
hover ×1
image-zoom ×1
itextsharp ×1
percentage ×1
size ×1
textbox ×1
vba ×1
width ×1
wpf ×1
zoom ×1