html - 头部如何向左显示

标签 html css angular typescript

我试图在此处显示 channel 列表每一行左侧的字母。我该怎么做?

<div class="w3-container w3-threequarter">
    <ul class="w3-ul w3-card-1" *ngFor="let head of channelDisplayHeads" >
     <h1 align="center" style="background-color:#0083BC"><font color="white">{{ head }}</font></h1>
      <ng-container *ngFor="let channel of channelList">
        <li class="list-group-item logoDisplay" *ngIf="channel.channel.substr(0, 1) === head">
            <img class="w3-image" src= "{{ channel.logo }}" align="center" alt="{{ channel.channel }}" width="80" height="80"><br>
            <!-- <span align="center"><strong><font size="2">{{ channel.channel }}</font></strong></span><br> -->
          <span class="w3-left"><mark><font size="1">{{ channel.cbsCode }}</font></mark></span><span class="w3-sand w3-right" style="text-shadow:0.2px 0.2px 0 #444"><font size="2">{{ channel.pickCode }}</font></span>
        </li>
      </ng-container>
    </ul>
  </div>

到目前为止,我是如何得到它的。我需要每行左侧的“A”、“B”、“C”。请指教! enter image description here

最佳答案

删除 align="center"来自 <h1>并添加 text-align: left

试试这个

<h1 style="background-color:#0083BC; text-align: left"><font color="white">{{ head }}</font></h1>

关于html - 头部如何向左显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47806581/

相关文章:

html - 元素底部边框上的三 Angular 形

css - 嵌套元素中的每 2n 个元素

jquery - 使用 HTML/JS 突出显示图像的特定部分

angular - 从 observable 的 finalize 方法返回一个 observable

javascript - 将特定日期之前的所有剩余日期插入 slider 中

html - 如何删除 anchor 元素上的突出显示?

html - 默认浏览器 CSS 未被覆盖

angular - 使用 *ngFor 自定义模板渲染

Angular 4 是真正在核心模块单例中提供的服务吗?

javascript - 如何在 Canvas 上使用多次点击事件