[HTML]Problemi float e adattamento sfondo

asevenx

Utente Attivo
7 Nov 2009
312
0
16
Salve a tutti. Sto realizzando un sito con alcuni moduli all'interno del quale ci sono due o più div con proprietà float per affiancarli uno all'altro, semplificando molto ho:
HTML:
<div class="grid_2_cols" style="background:red">
        <div class="col_1">...</div>
        <div class="col_2">...</div>
    </div>
Come detto col_1 e col_2 hanno proprietà float, e questo li rende correttamente affiancati. Mentre lo sfondo, così come moltre altre proprietà che vorrei applicare al div contenitore (grid_2_cols) sono visualizzabili esclusivamente se imposto un altezza, ma in ottica responsive vorrei evitare di impostare un altezza fissa. Come faccio ad ottenere lo sfondo del div contenitore adattandone la grandezza in base al contenuto? Ho provato anche ad aggiungere un div con propietà clear: both; ma senza risultati.
Grazie a tutti per l'aiuto.

PS: chiedo sucsa, ma per sbaglio ho inviato il messaggio senza alcun titolo e non so come aggiungerlo correttamente. Scusate ancora!
 
Discussioni simili
Autore Titolo Forum Risposte Data
O [HTML] problemi con la regola "background-attachment: fixed" in EDGE HTML e CSS 0
ANDREA20 [HTML] problemi con il footer HTML e CSS 1
Andrea_Ventura [HTML] Problemi con effetto hover HTML e CSS 5
Andrea_Ventura [HTML] Problemi con visualizzazione Navigation Bar HTML e CSS 10
C [Javascript] [HTML] Problemi: Overlay, Banner, Menu Javascript 4
L [HTML] Problemi a visualizzare le modifiche eseguite alle pagine del sito. HTML e CSS 2
G [HTML] Problemi con inserimento immagini HTML e CSS 7
S [HTML] Problemi con Blueimp image gallery su Chrome e Firefox HTML e CSS 2
W [HTML] problemi con sito responsive CMS (Content Management System) 1
A [HTML] Problemi con l'installazione di Disqus HTML e CSS 5
giuseppe_123 [HTML] Problemi wordpress WordPress 2
giuseppe_123 Problemi form php/html PHP 33
robertolp problemi e html php PHP 9
J Problemi grafici con un html tumblr HTML e CSS 1
P Problemi visualizzazione html con phpmailer PHP 6
F Problemi php-html PHP 0
I Risoluzioni problemi html HTML e CSS 7
A html e css problemi con explorer 8 HTML e CSS 0
A Html e visulizzazone explorer 8 - problemi HTML e CSS 1
antonio.amazza Apache-Tomcat : Problemi di visualizzazione pagine HTML Apache 0
W Problemi con filtro tabella HTML Javascript 0
F problemi con html nel blog HTML e CSS 2
PoLe [HTML] Per chi ha problemi con Front Page o Dreamweaver HTML e CSS 2
T Problemi frames pagina html HTML e CSS 3
P Problemi caricamento suono su codice html HTML e CSS 1
V problemi con invio email in formato html PHP 1
G Pagina html in stringa PHP 2
E Sostituzione Elemento Html PHP 3
G Elementi HTML HTML e CSS 1
K Visualizzare del html responsive in una Webview Sviluppo app per Android 0
T Domanda valutazione html LinkedIn 2022 pt3 HTML e CSS 7
T Domanda valutazione html LinkedIn 2023 pt2 HTML e CSS 15
T Domanda valutazione html LinkedIn 2023 pt1 HTML e CSS 1
MarcoGrazia Salvataggio HTML in database PHP 2
K posizionare variabile da pagina html all'iframe. Javascript 1
peppe0703 Come Estrarre dati da db wordpress e richiamarli in html esterno HTML e CSS 0
L problema collegamento file css con html HTML e CSS 1
D Informazioni da XAMPP su HTML PHP 0
R Immagini html HTML e CSS 2
K File audio in html, chi mi può aiutare? HTML e CSS 0
K Aiuto con file audio in html HTML e CSS 1
Antonio67 Lanciare file shell bash da html HTML e CSS 2
M Riportare in tabella HTML dati estratti con query SQL MySQL 0
G Codice html Javascript 1
M Collegamento tra form html e script php PHP 4
L Ricezione dei dati su file php da modulo html PHP 6
F Creare elementi html con javascript Javascript 3
G Appicazione HTML per inserimento dai in Database Access Microsoft HTML e CSS 0
W visualizzare solo file html e sottocartelle di una cartella PHP 1
C Dopo chiusura del tag php la stringa html va a capo PHP 1

Discussioni simili