小编Jof*_*heo的帖子

如何使可编辑的DIV看起来像文本字段?

我有一个DIV,contentEditable=true所以用户可以编辑它.问题是它看起来不像文本字段,因此用户可能不清楚它是否可以编辑.

有没有一种方法可以设置样式,DIV以便用户看起来像文本输入字段?

html css

77
推荐指数
3
解决办法
15万
查看次数

IE CSS显示:内联块渲染问题

我的IE代码有一个恼人的渲染问题

CSS:

div {
    display: inline-block;
    margin-right:40px;
    border: 1px solid;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<div>element</div>
<div>element</div>
<div>element</div>
<div>element</div>
<div>element</div>
Run Code Online (Sandbox Code Playgroud)

这是它在firefox/chrome中的外观(预期的显示)

在此输入图像描述

这就是它在IE中的样子

在此输入图像描述

如果IE支持display:inline-block,我用google搜索,显然它确实如此.

html css internet-explorer rendering

18
推荐指数
3
解决办法
3万
查看次数

为什么我的空div崩溃虽然它在使用显示内联时有宽度?

当我使用显示内联来放置div#hlogo,div#hdesign和div #hTestimonial时,div崩溃虽然我已经设置了它们的宽度..

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org    /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Slicing</title>

</head>

<body>
<div id="wrapper">
    <div id="header">
        <div id="hlogo">
                <div class="Hlogo">

                    <div id="Logoheader">RamblingSoul</div>
                    <div id="Logodesc">
                        <p> A Free CSS Template From </p>
                        <p>RamblingSoul</p>
                    </div>
                </div>

        </div>
        <div id="hdesign">

        </div>
        <div id="hTestimonial">

        </div>
    </div>
    <div id="body">
    </div>
    <div id="footer">
    </div>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)

CSS:

html,body{  
        margin:0px;
        padding:0px;
        width:100%;
        height:100%;

    }
div#wrapper{    
        margin:0px;
        padding:0px;
        width:100%;
        height:100%;
        line-height:normal;
        border: #060 thick groove;
        background-color:#FF3;
        font-size:10px; …
Run Code Online (Sandbox Code Playgroud)

html css

6
推荐指数
1
解决办法
5054
查看次数

按DIV元素布置表格

我很感兴趣如何创建一个像div一样只使用div元素的表格.我阅读了很多关于displayfloat样式属性的内容,我认为这段代码应该按照我的要求布局内容,但是我看到第二行移动到下面一个位置的表格.

我希望看到:

left1 right1
left2 right2
Run Code Online (Sandbox Code Playgroud)

但我知道

left1 
left2 right1
      right2
Run Code Online (Sandbox Code Playgroud)

这是我的CSS

.big {
    display: inline-block;
}

.small {
    display: block;
}

.left {
    display: inline;
}

.right {
    display: inline;
    float: right;
}
Run Code Online (Sandbox Code Playgroud)

在这里我的html文件:

<div class="big">
<div class="small">
    <div class="left">left1</div>
    <div class="right">right1</div>
</div>
<div class="small">
    <div class="left">left2</div>
    <div class="right">right2</div>
</div>
Run Code Online (Sandbox Code Playgroud)

我设法创建表(width: 100px.small选择器添加规则)但我不想指定我的DIV元素的宽度,因为它们可以具有不同的宽度.

谢谢

html css

6
推荐指数
1
解决办法
3815
查看次数

如何获得具有display:none的父元素的元素的高度?

如何获得具有父元素的元素的高度display: none

这里有一个例子:jsfiddle.net

谢谢

卢卡斯

html css jquery

4
推荐指数
1
解决办法
149
查看次数

如何以编程方式单击按钮 - WebBrowser(IE)中的按钮

我在互联网上搜索了一些例子;

"如何在C#中单击webBrowser(Internet Explorer)中的按钮?"

这是在谷歌工作的代码;

JS:

    void ClickButton(string attribute, string attName)
    {
        HtmlElementCollection col = webBrowser1.Document.GetElementsByTagName("input");
        foreach (HtmlElement element in col)
        {
            if (element.GetAttribute(attribute).Equals(attName))
            {
                element.InvokeMember("click");   // Invoke the "Click" member of the button
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

但我的网页按钮有不同的标签.因此程序无法检测到单击它.

我的主要问题是; 如何以编程方式单击按钮?

HTML:

<a class="orderContinue" href="Addresses" title="Sipar Ver">Sipar Devam</a>
Run Code Online (Sandbox Code Playgroud)

html c#

4
推荐指数
1
解决办法
7947
查看次数

有什么方法可以阻止特定的文本行溢出到下一行?

我目前有一个带有几个文本规则集的div标签,p,h1,h2 ......等等.

我想知道无论如何我可以做到这样,如果文本对于div的宽度变得太长而这些规则中的一个不会进入下一行,而是从div中运行的文本没有被显示在浏览器中?

所以,例如,我的p标签是正常的,如果文本行太长,它将简单地溢出到下一行,与我的h1和h2相同,但我希望我的h3只占用一行而从不占用多个,即使这意味着一些文本在div的边缘被切断.

HTML

<div id="box">

    <h1>This is the first header and this will overflow onto the next line when it gets too long.</h1>

    <h2>This is the second header and this will overflow onto the next line when it gets too long..</h2>

    <p>This is the paragraph and this will overflow onto the next line when it gets too long.</p>

    <h3>This is the third header and I do not want this to overflow when it gets too long... But it …
Run Code Online (Sandbox Code Playgroud)

html css text overflow

4
推荐指数
1
解决办法
1万
查看次数

如何选中复选框?

在我的应用程序的CMS中,我有一个编辑项目表单.

用户将要编辑的项目有一些复选框.

其中一些是在创建时选择的,并且该选择已存储在我的数据库中,因为它会影响项目在实际站点中的显示方式.

假设$checked是一个布尔变量,如果创建项目的用户选择了该框,则该属性为真,我的代码是什么以显示所选复选框if($checked)

html php

2
推荐指数
1
解决办法
9285
查看次数

Firefox一直在显示iframe的滚动条.如何隐藏它们

原始链接:http://www.webdeveloper.com/forum/showthread.php? 2355680-FF-has-problems-with-IFrames-scrolling-and- height

我一直是FireFox的粉丝,但现在我开始讨厌它了.我正在改变我的页面以获得IFrame,现在FireFox是一个痛苦的屁股,而IE就像一个魅力!

我的iframe如下:代码:

<iframe id="leftiframe" src="<?=$page?>" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100&#37;;">
</iframe>
Run Code Online (Sandbox Code Playgroud)

但FireFox继续在我的IFrame中向我展示Scrollbars,在那里scrolling=no.为什么FireFox不理解我不想要滚动条.此外,在FireFox中未正确报告IFrame的大小.不offsetHeight,clientHeight,scrollHeight或什么的.

html iframe firefox

1
推荐指数
1
解决办法
3917
查看次数

标签 统计

html ×9

css ×6

c# ×1

firefox ×1

iframe ×1

internet-explorer ×1

jquery ×1

overflow ×1

php ×1

rendering ×1

text ×1