JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Buttons › Buttons size
Tagged: button tag
- This topic has 8 replies, 2 voices, and was last updated 2 months ago by tbettinazzi@axioma.it.
-
AuthorPosts
-
October 31, 2024 at 1:19 pm #111684tbettinazzi@axioma.itParticipant
I need to create some small (30px) flat buttons with only an icon inside but centered.
I didn’t find any property to do that.
how can I do ?
Tks
November 4, 2024 at 4:10 pm #111708adminKeymasterPlease, refer to this sample with small buttons and icons: https://www.htmlelements.com/demos/button/basic/
Regards,
MarkovSmart UI Team
https://www.htmlelements.com/- This reply was modified 2 months, 2 weeks ago by admin.
November 4, 2024 at 4:20 pm #111710tbettinazzi@axioma.itParticipantIn that sample I see some buttons smaller than others, however I don’t see any way to control dimensions.
My need is to have button smaller than buttons shown in that example.
Also change the background color is a need.
Tks
November 5, 2024 at 7:44 am #111714adminKeymasterHi,
The size of the buttons is set through CSS. In CSS you have width and height properties which determine the size of the Button and any other HTML Element. For example, the round button in the sample is 48px. If you set it to 30px through CSS, it will be 30px.
Regards,
MarkovSmart UI Team
https://www.htmlelements.com/November 5, 2024 at 10:02 am #111719tbettinazzi@axioma.itParticipantI tried and I reduced the size using (cfg-button-inline is my class)
smart-button.cfg-button-inline {height :24px;
width:25px;
}
Now I see the correct size of the button but the icon is visible only partially in the bottom right corner.Inspecting the page I saw the internal <button> tag still have a 32×32 size.
Tks
- This reply was modified 2 months, 1 week ago by tbettinazzi@axioma.it.
- This reply was modified 2 months, 1 week ago by tbettinazzi@axioma.it.
November 8, 2024 at 8:10 am #111744tbettinazzi@axioma.itParticipantAlso using material icons the icon is shown only partially in the lower right corner.
What’s wrong ?
Tks
November 8, 2024 at 5:32 pm #111748tbettinazzi@axioma.itParticipantI prepared a testcase in codpen
https://codepen.io/tullio0106/pen/jOgQwrY
You’ll see the first button is not shown in the expected way.
Tks
November 12, 2024 at 9:09 am #111765adminKeymasterHi,
You can apply to the button tag using CSS the following: display: flex; and align-items: center; if you want the Text and Image to be aligned.
Regards,
MarkovSmart UI Team
https://www.htmlelements.com/November 12, 2024 at 1:14 pm #111770tbettinazzi@axioma.itParticipantTks but it still doesn’t work
The only change is that display:flex adds also a harmful new line.
I updated the testcase.
Tks
-
AuthorPosts
- You must be logged in to reply to this topic.