页眉,页脚和侧栏具有固定位置。中间的内容区域带有两个滚动条。浏览器上没有外部滚动条。我有一个可以在IE7和FF中使用的布局。我需要添加IE6支持。我该如何进行这项工作?
这是我当前CSS的近似值。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Layout</title>
<style>
* {
margin: 0px;
padding: 0px;
border: 0px;
}
.sample-border {
border: 1px solid black;
}
#header {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
height: 60px;
}
#left-sidebar {
position: absolute;
top: 65px;
left: 0px;
width: 220px;
bottom: 110px;
}
#right-sidebar {
position: absolute;
top: 65px;
right: 0px;
width: 200px;
bottom: 110px;
}
#footer {
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
height: …Run Code Online (Sandbox Code Playgroud) 好,
所以我有一个<figure>元素,我想transform: scale(1.2)在开启时使用:hover.
除了一个问题,它工作正常:左边重叠很好,右边保留在下一个元素下面.
这是JsFiddle
如您所见,左侧与前一个元素重叠,右侧"重叠"下一个元素.
这是html
<section class="list-cover">
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMTk0NDg4NjQ5N15BMl5BanBnXkFtZTgwMzkzNTgyMTE@._V1_SX214_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMjAyMDM2ODExNF5BMl5BanBnXkFtZTgwNTI2MjkzMTE@._V1_SY317_CR9,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMjIzMjgwMTQzMV5BMl5BanBnXkFtZTgwNDcyMjczMTE@._V1_SY317_CR0,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMTg1MTIwODYwMl5BMl5BanBnXkFtZTgwNjAwNzQzMTE@._V1_SY317_CR2,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
<figure>
<a href="" title="">
<img src="http://ia.media-imdb.com/images/M/MV5BMTgzNjQ4NjM1NF5BMl5BanBnXkFtZTcwNzQ4OTEzNw@@._V1_SY317_CR11,0,214,317_AL_.jpg" alt="" />
<figcaption>Caption Text</figcaption>
</a>
</figure>
</section>
Run Code Online (Sandbox Code Playgroud)
这是CSS:
.list-cover figure …Run Code Online (Sandbox Code Playgroud) 我在设计引号时遇到了问题.所以我要做的是将引号相对于文本向下拉一点,以便它排成一行.我玩相对和绝对定位,但无法弄清楚.该程序将成为一个随机引用生成器,并且结束引用的位置必须使得它相对于文本以相同的方式排列,如果它有一个占用多行的引用.
body {
background-color: rgb(44, 62, 80);
}
.quoteMachine {
margin: 100px auto 0 auto;
padding: 40px 60px;
max-width: 600px;
min-height: 225px;
border-radius: 5px;
background-color: white;
}
.theQuote {
text-align: center;
font-size: 30px;
color: rgb(44, 62, 80);
}
.quotetationMarks {
font-size: 60px;
font-weight: 600;
}
.quoteAuthor {
text-align: right;
font-size: 20px;
color: rgb(44, 62, 80);
}
.twitterButton {}Run Code Online (Sandbox Code Playgroud)
<div class="quoteMachine">
<div class="theQuote">
<blockquote><span class="quotetationMarks">“</span > They call me Mister Tiibs <span class="quotetationMarks">”<span></blockquote>
</div>
<div class="quoteAuthor">
- hello
</div>
<button class="twitterButton"></button> …Run Code Online (Sandbox Code Playgroud)我正面临用于 angular2 的日期选择器的问题。我尝试了https://material.angular.io/components/datepicker/examples 中的代码。此站点中显示的输出是我所需要的,但相反,我在页脚之后显示在页面底部的日历。示例中没有给出 CSS 更改。
我正在使用以下代码。
HTML:
<mat-form-field>
<input matInput [matDatepicker]="picker" placeholder="Choose a date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
Run Code Online (Sandbox Code Playgroud)
TS:
import {Component} from '@angular/core';
@Component({
selector: 'datepicker-overview-example',
templateUrl: 'datepicker-overview-example.html',
styleUrls: ['datepicker-overview-example.css'],
})
export class DatepickerOverviewExample {}
Run Code Online (Sandbox Code Playgroud)
屏幕截图: 我需要的输出(来自示例)
在下面的代码片段中,添加 svg 元素会导致出现垂直滚动条。删除 svg 就会删除滚动条。我想了解为什么会发生这种情况,以及是否有一个不可怕的解决方案(例如宽度:99%;高度:98%解决它,但这是一个令人厌恶的解决方案)。
我无法真正删除上面的 DIV 样式,因为其他 html 结构也位于这些容器中,需要它们在那里。
.menuquery {
border: 1px solid #ccc;
overflow: auto;
box-sizing: border-box;
}
.xainnersubformdefault {
/* allows the svg to autosize */
width: 100%;
height: 100%;
}
.xadatabox {
height: 100%;
/* essential for jtable to scroll and not leak */
}
.datachart {
width: 100%;
height: 100%;
/* position:relative; */
/* to make an svg fill its container, this is required, see stackoverflow 9566792 */
}
svg {
width: 100%;
height: …Run Code Online (Sandbox Code Playgroud)我是一个很新的引导程序,所以如果我的问题太简单,我很抱歉.
我想创建一个宽度为父容器的表,固定高度和滚动条(如果表包含太多行).
我试过这样做:
<table class="table">
<tbody style="height: 80px; overflow-y: auto;">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
它显示全宽度但没有滚动的全表,高度比我需要的大.
我也尝试添加display: block;:
<table class="table">
<tbody style="height: 80px; display: block; overflow-y: auto;">
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
</tbody>
</table>
Run Code Online (Sandbox Code Playgroud)
在这种情况下,滚动条出现但tr-tag的宽度不适合容器,它更短.
我也试图指定width=100%到tr和td标签没有运气.我该如何解决我的任务?
这个真的很头疼,我有一个表格中有三个复选框,我有标签,标签上有用cess设置的背景图片,问题是,我是如何让我的javascript将图像从curent图像更改为单击它时的第二个图像并选择复选框,从我所知道的javascript,它的工作,任何想法?由于先前的问题,即7和8,它也必须是这种方式
HTML:
<input type="checkbox" name="interest1" id="interest1" value="interested"style="display:block">
<input type="checkbox" name="interest2" id="interest2" value="interested"style="display:block">
<input type="checkbox" name="interest3" id="interest3" value="interested"style="display:block">
<p align="center">
<label for="interest_inet" id="label-interest1" onClick="func()"></label>
Run Code Online (Sandbox Code Playgroud)
CSS:
label {
border:1px solid red;
display:inline-block;
}
#label-interest1 {
background-image: url(images/internetbutton.gif);
width: 152px;
height:152px;
}
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
<script type="text/javascript">
function func()
{
if(document.getElementById('interest_inet').checked)
{
document.getElementById('label-interest1').style.backgroundImage=url(images/internetbutton.gif);
}
else
{
document.getElementById('label-interest1').style.backgroundImage=url(internetbuttonchecked.gif);
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
这是一个实时代码示例:http://jsbin.com/uburan/11/edit
所以我试图创建一个导航栏,中间有一个标题,一个按钮出现在右侧。如您所见,当我尝试执行此操作时,按钮出现在下一行和 div 之外:
.title-bar {
background-color: #48A6B8;
font-style: italic;
margin-bottom: 3%;
color: #fff;
}
.title {
text-align: center;
font-size: 36px;
line-height: 180%;
}
.buts {
float: right;
}Run Code Online (Sandbox Code Playgroud)
<div class="title-bar">
<div class="title">Title</div>
<div class="button">
<button class="buts">Whats Up</button>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
display:inline-block 似乎删除了文本的居中,所以我不能使用它......
提前致谢!
我是C初学者,我不明白为什么这段代码不起作用?
void main(){
char userInput = "a";
if(userInput == "a"){
printf("a");
} else printf("b");
getch();
}
Run Code Online (Sandbox Code Playgroud)
返回"b"
但这一个正在发挥作用
void main(){
char userInput;
if("a" == "a"){
printf("a");
} else printf("b");
getch();
}
Run Code Online (Sandbox Code Playgroud)
返回"a"
有什么不同?
我想使用 Bootstrap 发出结束警报。警报显示正确,但我无法关闭它。这段代码有什么问题吗?谢谢。
<div class="alert alert-warning alert-dismissable">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong>Warning!</strong>
</div>
Run Code Online (Sandbox Code Playgroud)