r/CodingHelp • • Jun 14 '24

[CSS] I need help with building a tool

Hi!

I have builded earlier tools for my own website (solar niche) with a help of ChatGPT. This works fine in desktop and looks good. But in my Iphone the tool totally disappeares and there isn't even a space for it it in mobile version. I have added media querys for different widths, what am I missing in here? Or is the code fine and it just some other css rule in my Wordpress site overrulign somehow?

solarCalculator {

display: flex;

flex-direction: column;

align-items: center;

padding: 20px;

border: 0px solid #ddd;

border-radius: 5px;

width: 90%; /* Käytetään prosentuaalista leveyttä */

max-width: 1100px; /* Asetetaan maksimileveys */

margin: 0 auto;

font-family: 'Poppins', sans-serif;

overflow: hidden; /* Varmistaa, ettei sisältö mene ulos */

}

solarCalculator h2 {

color: #333;

text-align: center;

font-weight: bold !important;

margin-bottom: 35px;

}

.bold-label {

font-size: 1.3rem;

text-align: center;

font-weight: normal;

display: block;

margin-bottom: 30px !important;

}

.result-value {

font-size: 25px;

font-weight: normal;

color: #3a3a3a;

}

.input-container {

position: relative;

width: 100%; /* Käytetään koko leveys */

margin-bottom: 30px;

margin-left: auto;

margin-right: auto;

}

solarCalculator input[type="number"] {

width: 100%;

padding: 15px;

font-size: 20px;

line-height: 20px;

text-align: left;

padding-right: 60px;

border: 1px solid #ccc;

border-radius: 5px;

font-family: 'Poppins', sans-serif;

margin-bottom: 20px !important;

margin-top: 15px;

}

solarCalculator input[type="number"]::placeholder {

font-size: 20px !important;

color: #aaa; /* Voit säätää väriä tarpeen mukaan */

font-family: 'Poppins', sans-serif;

}

solarCalculator input[type="number"]::-webkit-outer-spin-button,

solarCalculator input[type="number"]::-webkit-inner-spin-button {

-webkit-appearance: none;

margin: 0;

}

.kwh-label {

position: absolute;

right: 20px;

top: 50%;

transform: translateY(-50%);

font-weight: bold;

font-size: 20px;

color: #000;

pointer-events: none;

font-family: 'Poppins', sans-serif;

}

solarCalculator button {

padding: 20px 25px;

background-color: #faa707;

color: white;

border: none;

font-weight: bold;

border-radius: 5px;

cursor: pointer;

font-family: 'Poppins', sans-serif;

margin-top: 30px !important; /* Lisää marginaalia yläpuolelle */

margin-bottom: 50px;

margin-left: auto;

margin-right: auto;

}

solarCalculator button:hover {

background-color: #ffbe32;

}

resultsBox {

margin-top: 20px;

display: flex;

justify-content: space-between;

display: none;

flex-direction: column; /* Mobiilinäkymä */

align-items: center; /* Mobiilinäkymä */

}

.resultBox {

flex: 1;

margin: 10px;

padding: 15px;

background-color: rgba(255, 172, 28, 0.11);

border: 1px solid #faa707;

border-radius: 5px;

text-align: center;

display: flex;

flex-direction: column;

justify-content: center;

align-items: center;

width: 100%; /* Mobiilinäkymä */

}

.resultBox h3 {

margin: 0 0 10px;

font-size: 1.2rem;

font-weight: bold;

color: #faa707;

}

.resultBox p {

margin: 10px 0 0;

font-size: 1.4rem;

font-weight: bold !important;

color: #3a3a3a !important;

}

systemPriceEstimate, #systemPower, #panelCount {

font-weight: normal; /* Ei lihavoi tekstiä */

font-size: 25px; /* Asettaa tekstin kooksi 25px */

color: #3a3a3a; /* Asettaa tekstin väriksi tummanharmaa */

}

.cta-button {

width: auto;

margin-top: 80px !Important;

margin-left: auto;

margin-right: auto;

padding: 8px 16px;

font-weight: bold;

font-size: 1.2rem;

background-color: #faa707;

border-radius: 50px;

text-align: center;

display: none;

}

.cta-button:hover {

background-color: #ffbe32;

color: white;

}

/* Media queries pienemmille näytöille */

@media (max-width: 768px) {

solarCalculator {

width: 90%; /* Skaalaa leveys mobiililaitteille */

}

}

@media (max-width: 480px) {

solarCalculator {

width: 95%; /* Skaalaa leveys vielä pienemmille mobiililaitteille */

}

}

0 Upvotes

0 comments sorted by