How To Perfectly Align Image Button With HTML Input Textbox 이미지 버튼을 완벽하게 정렬하는 방법을 html 입력 텍스트 상자
The form element input with type text strangely refuses to align with an adjacent image button ( input element of type image ). 이상의 양식 요소를 입력 텍스트를 입력할 인접 이미지를 거부 버튼을 정렬할 수있습니다 (입력 요소를 입력 이미지). The problem is rather hard to solve as regular methods like using align or margin or padding or even adding whitespace to the image fails. 이 문제는 정기적인 방법으로 오히려 같은 하드를 해결하기 패딩을 사용하거나 혹은 정렬이나 여백에 해당 이미지를 공백을 추가에 실패합니다. Here is a surprisingly simple solution to this problem. 놀랍게도 간단한 해결 방법이 문제가 여기에있습니다. But first lets take a look at the problem. 그러나 먼저이 문제를 사용을보고합니다.
The input textbox above is misaligned with the image button above as you can see. 텍스트 상자의 입력 버튼 위에는 고르지 이상으로의 이미지를 볼 수있습니다. The code is: 이 코드는 :
The solution is deceptively simple. 현혹 해결 방법은 간단합니다. Here is the code which works: 여기가 바로 코드를 작동 :
Here is the demo: 여기가 바로 데모 :
Filed under 밑에 Headline News 헤드 라인 뉴스 , How To 하는 방법을 , Tech Note 기술 참고 사항 , Web 웹 | |
| |
RSS 2.0 rss 2.0 | |
Trackback 트랙백 this Article | 이 문서 |
Email this Article 전자 우편이 문서
You may also like to read 같은를 읽을 수있습니다 |





July 19th, 2006 at 10:02 pm 7 월 19 일 오후 10시 2분
what about aligning them both at the middle vertically? 중간에 수직으로 정렬 둘 다 무엇에 대해?
July 27th, 2006 at 11:44 pm 2006년 7월 27일에서 오후 11시 44분
align=absmiddle is deprecated. 정렬 = absmiddle하지 않기를합니다.
Can anyone explain why this behaviour happens, and why position: absolute solves it? 이 동작은 아무도 발생 이유를 설명하고, 그리고 왜 위치 : 절대적인 문제를 해결해어요?
I’m constantly coming across CSS problems but the solutions don’t leave me any the wiser 나는 전투 근무 지원 문제를하지만 솔루션을 통해 지속적으로 오는 날 떠나 지마 모든 사정을
August 8th, 2006 at 12:07 pm 2006년 8월 8일에서 오후 12시 7분
Kat: This is probably due to the “image baseline” issue, where there is whitespace at the bottom of an image. 캣 : 이것은 아마의 "이미지를 기준"문제를 해결하려면 하단에 공백이있는 곳으로 이미지를합니다. Since images are inline objects, they sit on the baseline and not at the bottom of the containing block. 이후 이미지가 인라인 개체를, 그들에 앉으세요의 하단에있는 기준이 아니라 블록을 포함합니다. Changing the style to “display: block;” would also work in an example like this. 스타일을 변경하여 "디스플레이 : 차단;"도 이런 예로에서 작동합니다.
November 21st, 2006 at 4:20 pm 2006년 11월 21일에서 오후 4시 20분
Ive been trying this and ive figured out that puting ur elements in a table, each in a différent cell is doing the alignment very well. 나는 이것을 다방면으로 노력하는 나는 퍼팅 위키 요소를 파악해 테이블을 정렬하고있는 각각의 세포는 아주 잘 différent.
Cause playing wit absolute positioning in a table can end up really messy. 재생 기지 원인 테이블에 절대적인 포지셔닝을 진짜로 끝낼 수있어 지저분합니다.
( normal textbox is setting height and text size from my CSS style sheet ) (정상적인 텍스트가 설정을 높이 및 텍스트 크기를 내 전투 근무 지원 스타일 시트)
January 5th, 2007 at 9:38 pm 2007년 1월 5일에서 오후 9시 38분
using vertical-align: text-bottom is the best way to achieve the desired effect 를 사용하여 수직 - 정렬 : 텍스트 - 맨 아래에 원하는 효과를 달성하는 최선의 방법은
February 1st, 2007 at 9:25 am 2007년 2월 1일에서 오전 9시 25분
Bonjour, 안녕하세요,
Sous IE6, le bouton Go est 1 pixel au-dessus du input 수의 800, 러 bouton 이동은 1 픽셀 누구나 - dessus 뒤 입력
Tout le monde le voit 투트 르 몽드 르 voit
June 28th, 2007 at 12:43 am 2007년 6월 28일에서 오전 12시 43분
Fantastic - I’ve used this to align PayPal shopping cart buttons so they don’t affect the page layout below them. 환상적인 - 나는 이것을 맞춥니다를 사용한 적이 페이팔 쇼핑 카트 버튼을 그래서 그들은 그들을 아래에 한 페이지 레이아웃에는 영향을주지 않습니다. It’sa problem with PayPal that has been bugging me for ages! 페이팔은 도청 문제를 이것이 나에게 적합! Thanks. thanks.
November 19th, 2007 at 2:05 am 2007년 11월 19일에서 오전 2시 5분
Bonjour, you can solve the 1 pixel problem easily. 안녕하십니까, 1 픽셀의 문제를 쉽게 해결할 수있습니다.
Complete Code: 전체 코드 :
November 19th, 2007 at 2:10 am 2007년 11월 19일에서 오전 2시 10분
asp:ImageButton ID=\ asp : imagebutton 번호 = \
May 7th, 2008 at 6:55 am 2008년 5월 7일에서 오전 6시 55분
Works a charm! 작품이 매력!
May 16th, 2008 at 11:08 pm 2008년 5월 16일에서 오후 11시 8분
This has been a booger… 이것은 부거가…
Didn’t work for me. 적합하지 않았던 나.
But I did use style=”vertical-align: middle” which worked like a charm. 하지만 그렇게 사용 스타일 = "수직 - 정렬 : 중간"를 마치 마법처럼 일을합니다.