The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> 2 CSS questions, simple?
CharlesEF
post Oct 11 2020, 08:29 PM
Post #1


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Hi All,

For years I've had to style < input > and < select > elements width differently. I had always 'assumed' the problem was with the custom fieldset and legend CSS supplied to me by Mozilla, because of a fieldset printing bug. I find that bug appears to be fixed now so I want to do away with the custom Mozilla CSS. So, I created a test page without the custom CSS but the problem still exists. Attached is the test page and image. When width is set to 100% the right end of the 2 elements don't match. Or, should they? The 2nd question is: why did I need a CSS rule to adjust the position of the help image? I needed it because the help image was placed outside the button.

Hope someone can help explain this to me.

Attached File  CSS_Test.html ( 5.58k ) Number of downloads: 226
Attached Image


Thanks for any and all help,

Charles
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Oct 12 2020, 01:21 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



Regarding text box width, this seems to work:

CODE

div {
display: inline-block;
border: solid;
}

div input, div select {
box-sizing: border-box;
display: block;
width: 100%;
}


See also https://developer.mozilla.org/en-US/docs/Le...yling_web_forms for INPUT text fields, and https://developer.mozilla.org/en-US/docs/Le...ed_form_styling for SELECT menus.

QUOTE
The 2nd question is: why did I need a CSS rule to adjust the position of the help image? I needed it because the help image was placed outside the button.

Could you make a minimal test case where the image is placed outside? unsure.gif



User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Oct 12 2020, 04:09 PM
Post #3


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(Christian J @ Oct 12 2020, 01:21 PM) *

QUOTE
The 2nd question is: why did I need a CSS rule to adjust the position of the help image? I needed it because the help image was placed outside the button.

Could you make a minimal test case where the image is placed outside? unsure.gif

The file I posted has the problem. Just over ride the '.help img' rule and you will see the image move to the left.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th April 2024 - 06:52 AM