• 请不要在回答技术问题时复制粘贴 AI 生成的内容
rizon
V2EX  ›  程序员

[已解决] 大佬们,急问一下 这个 css 样式要怎么对齐?

  •  
  •   rizon ·
    othorizon · Dec 17, 2018 · 2123 views
    This topic created in 2903 days ago, the information mentioned may be changed or developed.

    去掉一些无关信息,大概就是下面这个意思:

    <div text-algin=center>
    <text>第一行</text>
    <text>第二行</text<img>图片 1</img>
    <div>
    

    现在希望文字 “第一行”和“第二行” 居中对齐,“图片 1 ”显示在 “第二行”左侧的某个位置。

    请问这个怎么做到啊?

    5 replies  •  2018-12-18 11:32:08 +08:00
    cctvmot
    cctvmot
    Dec 17, 2018
    1
    太初级了吧!!!!!!!!!
    rizon
    rizon
    OP
    Dec 17, 2018
    2
    @cctvmot #1 不好意思哈,我不是做前端的,不太会。刚才找了个同事给解决了。

    元素加 绝对定位 就可以了
    shijianit
    shijianit
    Dec 17, 2018
    3
    <text>第二行</text 少了个 >
    shaojz2005
    shaojz2005
    Dec 17, 2018
    4
    看这代码没走在正路啊……绝对定位。。。
    gzd1214
    gzd1214
    Dec 18, 2018
    5
    Flexbox 值得拥有
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1922 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 15:14 · PVG 23:14 · LAX 07:14 · JFK 10:14
    ♥ Do have faith in what you're doing.