1

I'm trying to reduce the size of an input box on a mobile device and the css won't work.

I used google dev tools to get the name of the element (input#calc_shipping_postcode.input-text) but when I try and specify the width in CSS nothing happens.. the page is -https://ffe-dev.flowersforeveryone.co.za/flower-delivery/

the CSS i'm trying to use is -

    input#calc_shipping_postcode.input-text {
    width: 270px;
}

Can someone please tell me what i'm doing wrong? Thanks

1
  • there is an inline width applied for the element. Remove it and then add your css. or try adding !important to the rule. Commented Aug 13, 2019 at 9:30

2 Answers 2

3

The problem with your site is that width are set to 350px by inline styling.

This is caused from some wordpress plugin (maybe this set from WPBakey).

One solution is to find out what is causing this styling in wordpress then edit it.

Other fast workaround solution is to override ths by adding !important to your css property like:

input#calc_shipping_postcode.input-text {
  width: 270px !important;
}
Sign up to request clarification or add additional context in comments.

Comments

2

Instated of adding width in px use %. will work in all devices.

try this.

input#calc_shipping_postcode {
    width: 100% !important;
    max-width: 350px;
}

4 Comments

Nope,This won't change the width.
you can try this will work as fluid try doing that and then let me know.
I've just tried it, But maybe you've misunderstood the question. The question is about reducing the width. but with your code the width will remain 350px, Maybe you mean 270px not 350
i did mention if you use px will solve the issue but leave the space in landscape but if it in % will look perfect as bootstrap will max -width 350.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.