'Web/CSS'에 해당되는 글 8건
- 2010/02/03 UX를 편리하게 하기 위한 7 CSS 팁
- 2009/03/12 How to set css style on disabled FORM INPUT Tag
- 2009/02/09 CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2)
- 2008/06/21 버튼을 CSS로 이쁘게~
- 2008/01/28 IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2)
- 2008/01/24 DIV를 이용해 가운데 정렬 (1)
- 2007/09/11 IE와 W3C의 박스 차이에 의한 CSS 코딩 방식
- 2007/05/21 링크에 점선.. 아직도 onclick=this.blur()를 쓰나요? (3)
7 Quick CSS Enhancements for Better User Experience
- Firefox, Opera, and Safari에서만 됨
::selection { background:#c3effd; color:#000; /* Safari and Opera */ }
::-moz-selection { background:#c3effd; color:#000; /* Firefox */ }2. Prevent Firefox Scrollbar Jump
- Firefox용
html { overflow-y:scroll; }3. Rounded-Corner Elements
input { -moz-border-radius:10px; -webkit-border-radius:10px; }4. Print Page Breaks
.page-break { page-break-before:always; }5. Attribute-Specific Icons
a[href$='.pdf'] { padding:0 20px 0 0; background:transparent
url(/graphics/icons/pdf.gif) no-repeat center right; }6. CSS Pointer Cursors
input[type=submit],label,select,.pointer { cursor:pointer; }7. display:block Links
#navigation li a { display:block; }[참조사이트]
'Web > CSS' 카테고리의 다른 글
| UX를 편리하게 하기 위한 7 CSS 팁 (0) | 2010/02/03 |
|---|---|
| How to set css style on disabled FORM INPUT Tag (0) | 2009/03/12 |
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
잘 모르던 내용인데 Google Chrome 내에 있는 라이브러리를 보다가 알게 되었네요.
textarea:disabled,
input:not([type]):disabled,
input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="search"]:disabled {
background-color: #EBEBE4;
}
위와 같이 테그에 type 속성을 xpath 잡는 방식으로 잡네요. 그리고 그 뒤의 다른 속성 지정방식은 일반 CSS에서 하는 방식과 같으니 중요하진 않네요 ㅎㅎ
모르셨던 분들은 메모해두시길 ^ ^
'Web > CSS' 카테고리의 다른 글
| UX를 편리하게 하기 위한 7 CSS 팁 (0) | 2010/02/03 |
|---|---|
| How to set css style on disabled FORM INPUT Tag (0) | 2009/03/12 |
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
일단 핵심적인 내용을 먼저 하면
1. 문자열을 출력하는 영역에 너비(width)가 고정되어야 합니다.
2. 문자열의 넘어서는 부분을 생략(ellipsis)하고, 다른 넘어서는 부분은 안보이게(hidden) 처리합니다.
예를들어 다음과 같은 코드를 실행해보면
이해하시는데 빠를거에요 ^ ^
<table id=tb border=1 style="table-layout:fixed;">
<tr>
<td style="overflow: hidden; text-overflow:ellipsis; width:150px;">
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
</td>
</tr>
</table>
결과는 다음과 같이 ... 문자가 붙어 나타나죠 ^ ^
'Web > CSS' 카테고리의 다른 글
| UX를 편리하게 하기 위한 7 CSS 팁 (0) | 2010/02/03 |
|---|---|
| How to set css style on disabled FORM INPUT Tag (0) | 2009/03/12 |
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
CSS 버튼 미리 되어있는 템플릿
뭔가 작업할때 버튼이 어설퍼서 보기 좀그렇다면
http://poshopzil.com/gBtn_all/
다음 사이트에서 css에 버튼 모양 적용된 css를 가져다 쓰시면
쉽게 css 으로 미리 지정된 디자인을 가져다 쓰실 수 있습니다.
디자인쪽으로 참고 할만한 사이트..
참조 : 포샵질 다콤 (http://poshopzil.com )
'Web > CSS' 카테고리의 다른 글
| How to set css style on disabled FORM INPUT Tag (0) | 2009/03/12 |
|---|---|
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
| IE와 W3C의 박스 차이에 의한 CSS 코딩 방식 (0) | 2007/09/11 |
(자바스크립트를 통해서 처리하지만 CSS 관련된 내용과 가깝지 않은가 생각되어 CSS 카테고리에 옮겼습니다.)
먼저 두서없이 내용을 보시면 이해가 가지 않으실지 모르니...
다음 글을 읽어보시고
링크 : 배경 이미지 깜박거림(Background Image Flicker) 및 배경이미지의 반복적인 다운로드 문제에 대하여
이에 대한 해결책으로 아래와 같은 코드를 사용하는구나 하는정도로 이해하시면 되겠네요 ~ ^ ^
try { // IE only
document.execCommand('BackgroundImageCache', false, true);
} catch(e) { }
'Web > CSS' 카테고리의 다른 글
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
|---|---|
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
| IE와 W3C의 박스 차이에 의한 CSS 코딩 방식 (0) | 2007/09/11 |
| 링크에 점선.. 아직도 onclick=this.blur()를 쓰나요? (3) | 2007/05/21 |
http://flumpcakes.co.uk/css/center-div-ie
div 테그를 이용해 표시되는 박스 형태의 레이아웃을 화면 가운데로 정렬하고 싶어하는 경우가 있습니다.
이럴때 대부분 table 테그에서 align=center를 많이 써 보셨기 때문에 text-align:center 를 사용하시는 경우가 많은데요.
이럴때는 다음과 같이 margin:0 auto; 를 사용하셔야 제대로 표현할 수 있습니다.
다음 사이트를 확인해보시면 보실 수 있습니다.
http://flumpcakes.co.uk/css/center-div-ie
'Web > CSS' 카테고리의 다른 글
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
|---|---|
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
| IE와 W3C의 박스 차이에 의한 CSS 코딩 방식 (0) | 2007/09/11 |
| 링크에 점선.. 아직도 onclick=this.blur()를 쓰나요? (3) | 2007/05/21 |
Trackback : http://i-ruru.com/trackback/265
-
Subject div 가운데 정렬
2009/02/17 13:00
http://ruru.tistory.com/entry/DIV%EB%A5%BC-%EC%9D%B4%EC%9A%A9%ED%95%B4-%EA%B0%80%EC%9A%B4%EB%8D%B0-%EC%A0%95%EB%A0%ACmargin: 0 auto;이때 margin 0의 주는 의미는 뭘까?화면상의 차이는 없는데
IE와 W3C에서 사용하는 BOX의 크기는 다르게 설정되어있어서 사이즈가 다르게 나오는 것들이 많이 있다.
이를 해결하기 위한 방안이 아래 설명되어 있다.
이하는 원문의 내용을 발췌한 내용..
The W3C Box model
First a look at the the W3C box model, which is used by all standards compliant browsers and by Internet Explorer 6 and later if the circumstances are right. In the W3C CSS box model a block level element’s total width is calculated using the following formula:
total width = margin-left + border-left + padding-left + width + padding-right + border-right + margin-right
The same concept applies to height, but for the sake of simplicity I will only talk about width from now on.
The IE Box model
The IE Box model is similar except for one important difference: paddings and borders are not included in the calculation:
total width = margin-left + width + margin-right
This means that if the element also has horizontal padding and/or borders, the actual content area will shrink to make room for them.
IE versions
Versions 5.5 and earlier of Internet Explorer for Windows always use the IE Box model. What many do not seem to be aware of is that IE 6 and later use the W3C box model when in standards compliant mode. This is a good thing since it means that problems will only occur in IE/Win 5.5 and older, provided that you use a DOCTYPE that makes IE use standards compliant mode.
Attacking the problem
By making sure that IE 6 is in standards compliant mode, you only have to care about this whole thing if you still are concerned about your sites looking the same in IE 5.*/Win as in more recent browsers. If that includes you there are several ways of attacking the problem, listed here in my order of preference:
- Avoid situations that cause problems
- Insert extra markup
- Use conditional comments
- Use CSS hacks
Since the problems caused by the Box model differences are often only cosmetic, my personal preference is to simply not bother with IE 5.*/Win. Sometimes that isn’t acceptable and I have to use one of the methods I’ll describe here.
1. Avoid situations that cause problems
This is how I prefer to solve the problem. I simply avoid specifying both width and padding or border for the same element. This ensures that all browsers will use the same total width, no matter which box model they use.
Let me use an example to illustrate. The HTML used to mark up a list of news articles could look like this (simplified):
<div id="news"><h2>News</h2><ul><li><h3>News article 1</h3><p>Lorem ipsum dolor sit amet</p></li><li><h3>News article 2</h3><p>Lorem ipsum dolor sit amet</p></li></ul></div>
To make the list 250 pixels wide with a one pixel border and 10 pixels of padding, you could use the following CSS:
#news {padding:10px;border:1px solid;width:228px;}
In standards compliant browsers, the total width will be 250 pixels (1px left border + 10px left padding + width + 10px right padding + 1px right border). In IE 5.5 and earlier, the total width will be 228 pixels since it doesn’t add paddings and borders.
So how can you avoid this? Let’s assume that the news list is in another container, for instance a sidebar:
<div id="sidebar"><div id="news">...</div></div>
If that is the case you can set the width on that container instead:
#sidebar {width:250px}#news {padding:10px;border:1px solid;}
Since #news is a block level element it will automatically fill the entire width of its parent element, which in this case is #sidebar.
2. Insert extra markup
If you can’t use method 1, another method is to insert extra markup. Using the same example as previously, assume that #news is not supposed to expand to the full width of #sidebar. Specifying a width for #news to prevent that is a the scenario you want to avoid. A workaround is to change the markup to this:
<div id="news"><div><h2>News</h2><ul>...</ul></div></div>
and use the following CSS:
#news {width:250px}#news div {padding:10px;border:1px solid;}
The outer element controls the width, and the inner element contains the border and padding.
It’s up to you to decide whether it is a reasonable compromise to add extra markup like this. It is obviously better if you can avoid doing so, but an extra div element doesn’t cause any other problems than increased file size and slightly reduced markup maintainability. It does not affect accessibility or how the document is presented with CSS off. Besides, having an extra element is necessary to create certain designs, so you may already have the markup you need.
3. Use conditional comments
If there is no suitable element that can be used to control the width and you can’t or won’t add extra markup, IE 5.*/Win needs to get a different value for width.
In my opinion, the safest way of doing that is to use conditional comments, which are comments whose content is only visible to IE/Win. In this case only IE below version 6 are supposed to get the contents:
<!--[if lt IE 6]><style type="text/css">#news {width:250px}</style><![endif]-->
If you choose to use this method I recommend moving all IE 5.*/Win specific CSS to a separate file and load it like this:
<!--[if lt IE 6]><link rel="stylesheet" type="text/css" href="/css/ie5.css"><![endif]-->
This is a safe way of ensuring that only the browsers that need the modified CSS see those rules.
4. Use CSS hacks
Finally you can also use a CSS hack to supply modified values to IE 5.*/Win. I recommend avoiding CSS hacks as much as possible. Just like the name implies, these are hacks, and hacks that are based on undocumented errors in different browsers’ CSS parsing. Since many people still use CSS hacks I’m mentioning it anyway. I highly recommend that you consider other options before using them unless you know exactly what you are doing.
The simplest CSS hack for working around box model problems is The simplified box model hack, SBMH. Provided that the HTML is the same as in the first example, the CSS would look like this:
#news {padding:10px;border:1px solid;width:250px;w\idth:228px;}
All browsers see and understand width:250px. IE 5.*/Win does not understand the next line, w\idth:228px, which all standards compliant browsers do. The result is that width is set to 250px in IE 5.*/Win and 228px standards compliant browsers, giving the list the same total width in all browsers.
Conclusion
As I have shown here it is possible to avoid or work around the problems caused by the different CSS box models. Which method you use will depend on the circumstances.
I should also mention that some time in the distant future, the CSS 3 `box-sizing` property will let you choose which CSS box model you want browsers to use. The W3C box model is called `content-box` and the Internet Explorer box model is called `border-box`. Being able to control this in all browsers is a good thing since each model has its pros and cons. However, browser support is currently too limited for this property to be of any practical use.
Hopefully none of this will be necessary in a couple of years. IE 7 was released in October 2006, and for every day fewer and fewer use the older versions of IE. It is already acceptable for some sites to hide all CSS from IE/5.* or to simply not care about the rendering differences.
I’ll leave it to you to decide when you can start hiding CSS from IE 5.*/Win.
'Web > CSS' 카테고리의 다른 글
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
|---|---|
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
| IE와 W3C의 박스 차이에 의한 CSS 코딩 방식 (0) | 2007/09/11 |
| 링크에 점선.. 아직도 onclick=this.blur()를 쓰나요? (3) | 2007/05/21 |
링크를 클릭하게 되면 링크 주변에 점선이 생기게되죠.
물론 그대로 두는 것이 웹표준 접근성에 맞겠지만
모양을 중요시하는 경향이 국내에선 많기 때문에 링크에는 항상 onclick 이벤트에 this.blur() 자바스크립트를 이용해서 링크에 점선이 생기는걸 막고는 했죠.
이를 한번에 해결하려면 a 테그의 스타일을 정의할 때 아래와 같은 한줄을 넣어주시면 됩니다. ^ ^
a { selector-dummy: expression(this.hideFocus=true;}
상당히 간단하고 쉽게 링크의 점선을 없앨 수 있겠죠? ^ ^
많이 활용하자고용~
'Web > CSS' 카테고리의 다른 글
| CSS 범위 넘어가는 글자에 자동으로 ... 붙이는 방법 (2) | 2009/02/09 |
|---|---|
| 버튼을 CSS로 이쁘게~ (0) | 2008/06/21 |
| IE 6에서 나타나는 배경이미지 깜빡임 현상 수정 (2) | 2008/01/28 |
| DIV를 이용해 가운데 정렬 (1) | 2008/01/24 |
| IE와 W3C의 박스 차이에 의한 CSS 코딩 방식 (0) | 2007/09/11 |
| 링크에 점선.. 아직도 onclick=this.blur()를 쓰나요? (3) | 2007/05/21 |
Trackback : http://i-ruru.com/trackback/30
-
Subject 웹 접근성을 저해시키는 자바스크립트 링크
2009/01/02 20:03
위 이미지는 어느 사이트의 게시판에 공지사항으로 등록된 안내문입니다. 이 게시판의 공지사항은 링크가 걸려있고 클릭하면 내용을 열람할 수 있습니다. 이 링크를 탭 브라우저를 사용하여 새 탭으로 열려고 했습니다. 그러나 예상했던 동작과 달리 해당 페이지는 현재 보고 있는 탭에서 열렸습니다. 왜 그런지 브라우저의 상태 표시줄을 주목해보니, 이렇게 자바스크립트를 사용하여 페이지를 전환하도록 만들어져 있었습니다. 이런 방식의 자바스크립트 사용은 매우 안 좋은..




Prev




