Hi, Splunkers,
I used the following code to change my dropdown input width,
.input-dropdown { min-width: 120px !important; width: 120px !important; max-width: 120px !important; } .splunk-dropdown .select2-container { min-width: 120px !important; width: 120px !important; max-width: 120px !important; }
when I changed width, the width of the dropdown area decreased, but the dropdown field width not change, which caused the dropdown overlapped with the next dropdown.
I tried some different combination of these widths, also the following HTML text/css, also margin-bottom, etc, etc, but whatever I tried, only the width of whole area dropdown changed, never worked for the dropdown box width.
I also tried the following CSS code, but have the same issue.
<html> <style type="text/css"> #input_unit { width: 440px; } </style> </html>
thx in advance.
Kevin
Sorry, my mistake. There was an extra semi-colon which should be removed.
<html>
<style type="text/css">
#TargetSEValidationID div[data-component="splunk-core:/splunkjs/mvc/components/Dropdown"]
{
max-width: 140px !important;
width: 120px !important;
}
</style>
</html>
Try something like this
<html>
<style type="text/css">
#input_unit div[data-component="splunk-core:/splunkjs/mvc/components/Dropdown"]
{
width: 440px; !important;
}
</style>
</html>
ITWhisperer,
thx for your quick response.
I put your code in front of my dropdown id TargetSEValidationid.
unfortunately, width change not working here, I attached a screenshot below.
besides, this code looks inserts a line break before it. whatever width I put here, there is always just a line break.
I am pretty sure, this code causes this line break.
<html>
<style type="text/css">
#TargetSEValidationid div[data-component="splunk-core:/splunkjs/mvc/components/Dropdown"]
{
width: 100px; !important;
}
</style>
</html>
<input id="TargetSEValidationid" type="dropdown" token="t_TargetSEValidation" searchWhenChanged="true">
<label>TargetSEValidation</label>
<choice value=".">ALL</choice>
<choice value="TRUE">TRUE</choice>
<choice value="FALSE">FALSE</choice>
<default>.</default>
<initialValue>.</initialValue>
</input>
Kevin
Two things: you could try adding max-width: as well as width, and also the changes don't show up in edit mode, you have to save the changes
Hi, ITWhisperer,
Now I added max-width, it looks better, but not fully working, now, field box width changed, but area width not changed.
before I added max-width, area width decreased, but field box not changed.
#TargetSEValidationID div[data-component="splunk-core:/splunkjs/mvc/components/Dropdown"]
{
width: 120px; !important;
max-width: 140px; !important;
}
Kevin
Sorry, my mistake. There was an extra semi-colon which should be removed.
<html>
<style type="text/css">
#TargetSEValidationID div[data-component="splunk-core:/splunkjs/mvc/components/Dropdown"]
{
max-width: 140px !important;
width: 120px !important;
}
</style>
</html>
I added another css here, it works now, not sure why, but it works beautifully as I expected.
thank you very much.
#TargetSEValidationID {
width: 140px;
}
#TargetSEValidationID div[data-component="splunk-core:/splunkjs/mvc/components/Dropdown"]
{
width: 120px; !important;
max-width: 140px; !important;
}
#TargetSEValidationID {
width: 140px;
}
just tried, after removing semi-colon, box width showing some difference, but area width still no change.
basically, I have many input fields here, want to shrink them to save some space.
if only box width is decreased, it won't save any space.
Kevin