1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Center Script

Discussion in 'HTML & Website Design' started by dooma, Apr 13, 2018.

  1. #1
    Hello

    Please I want to center my twitter integration in the middle of my html/css web page. I put it between <center></center> but nothing happened ?!
    SEMrush
    <body>
    
    <!-- status spinner showing while loading the page -->
    <div id="preloader"></div>
    
    <div id="content-wrap">
    
    <a class="twitter-timeline" href="https://twitter.com/myuser">dooma's Tweets</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
    
        <!-- FOOTER -->
    Code (markup):
    Thank you
     
    dooma, Apr 13, 2018 IP
    SEMrush
  2. phpmillion

    phpmillion Member

    Messages:
    142
    Likes Received:
    11
    Best Answers:
    4
    Trophy Points:
    45
    #2
    I don't see any center tags in your code?
     
    phpmillion, Apr 14, 2018 IP
  3. dooma

    dooma Active Member

    Messages:
    192
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #3
    i put it but when it didn't make effect. i removed it.
     
    dooma, Apr 14, 2018 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    8,651
    Likes Received:
    1,561
    Best Answers:
    225
    Trophy Points:
    515
    #4
    Script tags are non-rendering elements. You cannot target them for style as they do not exist in the render process. They can CREATE rendered elements, using the (dumbass) innerHTML method or via document.createElement, which is why you would need to go to the document inspector to figure out which tags twitter is creating on the DOM.

    I don't use Twitter integration myself (I have little respect for the TLDR mouth-breathers that make up their core fanbase) so I can't remember if they add an iframe, object, or directly add DIV to the page -- but that's what you'd have to figure out during inspection. Find out what tags the script is creating and target those, instead of trying to target the <script> tag which doesn't even EXIST for styling on a page.

    Also don't use <center>, that tag hasn't even EXISTED in HTML for over twenty years -- and for good reason. You don't say what you want things to look like in your HTML, that's CSS' job!
     
    deathshadow, Apr 14, 2018 IP