添加边框...... [英] Adding borders...

查看:89
本文介绍了添加边框......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用定义悬停子类的类的锚。问题是

,锚本身没有任何边框,当悬停时它会添加一个

边框,问题是当它添加边框时,文本转移。

有没有人知道如何纠正这个问题?我想创建

a透明或隐形边框(spacer),这样就可以在需要时显示

可见边框的空间,但我似乎无法得到它工作。

访问 http://callandermats.adconn.com/ 并将鼠标悬停在左侧链接上以查看

我的意思。样式表是:


..menu {

字体大小:12px;

text-decoration:none ;

}

..menu:悬停{

border-style:凹槽;

border-width: 1;

宽度= 100%;

}


谢谢!

I have an anchor using a class that defines a hover subclass. The issue is
that the anchor itself doesn''t have any border and when hovered it adds a
border, the problem is that when it adds the border, the text gets shifted.
Does anyone have any idea how to correct this issue? I would like to create
a transparrent or invisible border (spacer) so that there''s room for the
visible border to appear when needed but I cannot seem to get it to work.
Visit http://callandermats.adconn.com/ and hover over left links to see what
I mean. The style sheet for this is:

..menu{
font-size:12px;
text-decoration:none;
}
..menu:hover{
border-style:groove;
border-width:1;
width=100%;
}

Thanks!

推荐答案

" Jon Glazer" < JG *************** @ adconn.com>写道:
"Jon Glazer" <jg***************@adconn.com> wrote:
我有一个锚,使用一个定义悬停子类的类。问题是锚本身没有任何边框,当它悬停时它会增加一个
边框,问题是当它添加边框时,文本会被移动。
有谁知道如何纠正这个问题?我想创建一个透明或不可见的边框(间隔),这样就可以在需要时显示可见边框的空间,但我似乎无法让它工作。


border-color:透明;或者你的背景颜色如果

你有一个坚实的背景而不是图像。

访问 http://callandermats.adconn.com/

要修复的语法错误很多:
http://validator.w3.org/check?uri=ht ... ts.adconn.com/
http://jigsaw.w3.org/css-validator/v...1&profile=css2


无论如何,我看到IE6或Opera 7.54都没有移动文本。在Opera中

只显示左右边框,而不是顶部和底部边框,

和链接都是不同的宽度(可能是因为Opera是

正确地忽略你的虚假宽度,见下文)。

并将鼠标悬停在左侧链接上,看看我的意思是什么。样式表是:

.menu {
font-size:12px;
text-decoration:none;
}


像素对于font-size来说是一个非常糟糕的主意。更可取或不设置

a大小,更可取。

.menu:悬停{
border-style:groove;
border-宽度:1;


1什么?

宽度= 100%;
}
I have an anchor using a class that defines a hover subclass. The issue is
that the anchor itself doesn''t have any border and when hovered it adds a
border, the problem is that when it adds the border, the text gets shifted.
Does anyone have any idea how to correct this issue? I would like to create
a transparrent or invisible border (spacer) so that there''s room for the
visible border to appear when needed but I cannot seem to get it to work.
border-color: transparent; or whatever your background colour is if
you have a solid backgound rather than an image.
Visit http://callandermats.adconn.com/
Lots of syntax errors to fix:
http://validator.w3.org/check?uri=ht...ts.adconn.com/
http://jigsaw.w3.org/css-validator/v...1&profile=css2

Anyway, I see no shifting text in either IE6 or Opera 7.54. In Opera
only the left and right borders show up, not the top and bottom ones,
and the links are all different widths (probably because Opera is
correctly ignoring your bogus width, see below).
and hover over left links to see what
I mean. The style sheet for this is:

.menu{
font-size:12px;
text-decoration:none;
}
Pixels are a very bad idea for font-size. Percentages, or not setting
a size at all, are much preferable.
.menu:hover{
border-style:groove;
border-width:1;
1 what?
width=100%;
}




无效语法和宽度不适用于内联元素如此毫无意义


Steve



Invalid syntax and width doesn''t apply to inline elements so pointless

Steve


哇语法错误是滑稽。该网站是完全有效的,我不能

在该验证工具中找到一个真实的错误。


哦。它有效。


至于我遇到的问题,我通过创建一个相同颜色的边框来解决它

作为背景。


谢谢,

Jon

" Steve Pugh" < ST *** @ pugh.net>在消息中写道

news:pa ******************************** @ 4ax.com ...
Wow the syntax errors are funny. The site is totally valid and I cannot
find one truthfull error in that validator tool.

Oh well. It works.

As for the problem I had, I resolved it by creating a border the same color
as the background.

Thanks,
Jon
"Steve Pugh" <st***@pugh.net> wrote in message
news:pa********************************@4ax.com...
" Jon Glazer" < JG *************** @ adconn.com>写道:
"Jon Glazer" <jg***************@adconn.com> wrote:
我有一个锚,使用一个定义悬停子类的类。问题
是锚本身没有任何边框,当它悬停时会添加一个
边框,问题是当它添加边框时,文本得到
转移。
有谁知道如何纠正这个问题?我想创建一个透明或不可见的边框(spacer),这样就可以在需要的时候出现可见的边框,但我似乎无法让它工作。
I have an anchor using a class that defines a hover subclass. The issue
is
that the anchor itself doesn''t have any border and when hovered it adds a
border, the problem is that when it adds the border, the text gets
shifted.
Does anyone have any idea how to correct this issue? I would like to
create
a transparrent or invisible border (spacer) so that there''s room for the
visible border to appear when needed but I cannot seem to get it to work.



border-color:transparent;或者你的背景颜色,如果你有一个坚实的背景而不是一个图像。



border-color: transparent; or whatever your background colour is if
you have a solid backgound rather than an image.

访问 http://callandermats.adconn.com/



要修复的语法错误很多:
http://validator.w3.org/check ?uri = ht ... ts.adconn.com/
http://jigsaw.w3.org/css-validator/v...1&profile=css2

无论如何,我看到IE6或Opera 7.54都没有移动文本。在Opera中
只显示左右边框,而不是顶部和底部边框,
和链接都是不同的宽度(可能是因为Opera正确地忽略了你的虚假宽度,见下文)。



Lots of syntax errors to fix:
http://validator.w3.org/check?uri=ht...ts.adconn.com/
http://jigsaw.w3.org/css-validator/v...1&profile=css2

Anyway, I see no shifting text in either IE6 or Opera 7.54. In Opera
only the left and right borders show up, not the top and bottom ones,
and the links are all different widths (probably because Opera is
correctly ignoring your bogus width, see below).

并将鼠标悬停在左侧链接上,看看我的意思是什么。样式表为:

.menu {
font-size:12px;
text-decoration:none;
}
and hover over left links to see what
I mean. The style sheet for this is:

.menu{
font-size:12px;
text-decoration:none;
}



像素对于字体大小来说是一个非常糟糕的主意。更可取或不设置尺寸的百分比更可取。



Pixels are a very bad idea for font-size. Percentages, or not setting
a size at all, are much preferable.

。菜单:悬停{
border-style:groove;
border -width:1;
.menu:hover{
border-style:groove;
border-width:1;



1什么?



1 what?

width = 100%;
}
width=100%;
}



无效的语法和宽度不适用于内联元素,因此毫无意义

Steve



Invalid syntax and width doesn''t apply to inline elements so pointless

Steve



Re: http://validator.w3.org/check ?uri = ht ... ts.adconn.com/

Jon Glazer< jg *************** @ adconn.com>写道:
Re: http://validator.w3.org/check?uri=ht...ts.adconn.com/
Jon Glazer <jg***************@adconn.com> wrote:
哇语法错误很有趣。该网站完全有效,我无法在该验证工具中找到一个真实的错误。
Wow the syntax errors are funny. The site is totally valid and I cannot
find one truthfull error in that validator tool.




嗯?


您的意思是 http://callandermats.adconn.com/ 不会丢失一堆

必需的属性(TYPE用于STYLE和SCRIPT元素,ALT用于IMG

元素)?


它没有不要使用未在DTD中定义的属性(b
声称要使用它们)(表格和TR元素中的HEIGHT,TD元素中的背景)?


没有多余的< html>和< head>

文件中间的标签?


不要错过属性值周围的引号需要

引号,当SGML解析器试图解析

属性值为标记时导致一系列问题?

-

Darin McGrew, da *** @ TheRallyeClub.org http://www.TheRallyeClub.org/

噱头车不是一场比赛,而是一个有趣的拼图测试你的

能够遵循指示。即将到来的噱头汽车拉力赛

硅谷:TRC成立24周年(2月5日星期六)



Huh?

You mean that http://callandermats.adconn.com/ isn''t missing a bunch of
required attributes (TYPE for STYLE and SCRIPT elements, ALT for IMG
elements)?

That it doesn''t use attributes that are not defined in the DTD that it
claims to use (HEIGHT in TABLE and TR elements, BACKGROUND in TD elements)?

That there aren''t extraneous <html> and <head> tags in the middle of the
document?

That there aren''t missing quotes around attribute values that require
quotes, causing a cascade of problems when the SGML parser tries to parse
the attribute values as markup?
--
Darin McGrew, da***@TheRallyeClub.org, http://www.TheRallyeClub.org/
A gimmick car rallye is not a race, but a fun puzzle testing your
ability to follow instructions. Upcoming gimmick car rallye in
Silicon Valley: TRC''s 24th Anniversary (Saturday, February 5)


这篇关于添加边框......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆