簡體   English   中英

有沒有辦法使此HTML和CSS在可教學頁面上工作?

[英]Is there a way to make this HTML and CSS work on a Teachable page?

因此,在名為Teachable的平台上使用HTML和CSS時遇到了一些困難。

基本上,我嘗試制作2列:-第1列-圖片-第2列-文本

當我只將<div class="column">放在第1列上時,我得到了:

版式1

當我在兩個部分上都放置<div class="column">時,我在這里可以看到。

版面2

如您所見,在這種情況下,第2列變得非常狹窄。 是否可以使第1列的寬度約為25%,而使第2列的寬度約為75%?

這是我正在使用的CSS代碼:

/* Three image containers (use 25% for four, and 50% for two, etc) */
.column {
  float: left;
  width: 33.33%;
  padding: 5px;
}

/* Clear floats after image containers */
.row::after {
  content: "";
  clear: both;
  display: table;
}

 /*created separate classes for div sections of img and text*/ /*column-1 is img div*/ .column-1 { float: left; width: 25%; height: 100%; padding: 5px; } /*img must be set to 100% width to fill div container*/ img { width: 100%; } /*column-2 is text div*/ .column-2 { width: 75%; padding: 5px; } /*Change padding and width to fit your needs.*/ 
 <html> <head> <link rel="stylesheet" href="style.css"> </head> <body> <div class="column-1"> <img src="SS_img_01-2-s.jpg"> </div> <div class="column-2"> <p> As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. As you can see, column 2 becomes very narrow in this case. </p> </body> </html> 

這是我認為您要達到的目標,但是,我可能是錯的。

編輯:好的,所以您可以只在第1列中添加'height:100%',除非您想在img下面包含內容,但是如果只是img和文本,那應該沒問題。 如果確實需要在img下方添加內容,我認為使用z-index並以正確的方式放置元素應該可以。 希望這是您要尋找的。 另外,由於某種原因,代碼片段未顯示我在其上運行代碼時得到的結果,因此請確保檢查其是否正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM