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

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

  •  
  •   rizon ·
    othorizon · Dec 17, 2018 · 1992 views
    This topic created in 2796 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
        1
    cctvmot  
       Dec 17, 2018
    太初级了吧!!!!!!!!!
    rizon
        2
    rizon  
    OP
       Dec 17, 2018
    @cctvmot #1 不好意思哈,我不是做前端的,不太会。刚才找了个同事给解决了。

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