52386

Marquee text sliding to center of div

I have the following marquee:

<div id="tip"><marquee loop="1" direction="right" behavior="slide">Text</marquee></div>

The above code moves the text from left to right and stops at right edge of div. Is there a way to force it to stop in center of div? I can't use paddings because the text is random and doesn't have a fixed length.

current behavior:

--------------------------------------------------------------------------
 >      >      >      >      >      >       >      >      >          Text
--------------------------------------------------------------------------
</pre>

My desired behavior:

--------------------------------------------------------------------------
    >    >     >    >     >     >   Text
--------------------------------------------------------------------------
</pre>
    

Answer1:

would not advice you to use marquee but if you really want to, then you can do this to get your desired effect

<div id="tip"> <div class="stop"> <marquee loop="1" direction="right" behavior="slide">Text</marquee> </div> </div>

css

.stop{width:*your choice*;}

Answer2:

All you need to type is in plain html

marquee loop="1" direction="right" behavior="slide">center Text /center /marquee

you do not need to know css and be sure to include center tags inbetween the marquee tags. have fun!!

Recommend

  • How do you download a image/png data URI in Edge?
  • Controlling tab space in a using CSS?
  • How do I get sikuli to wait until the mouse pointer changes from “busy” to “not busy?”
  • Radio button show hover between two radio button using jquery
  • Linear gradient not applying in Webkit with d3 generated SVG
  • Remove border around the color in an input[type=color] in Firefox?
  • Overriding window.location on Webbrowser Control
  • How to call MoveDataTableCursor in a web test plugin to go through a limited set of rows in a table?
  • How to change default stop edit behavior in jtable
  • R h2o.glm - issue with max_active_predictors
  • What is this strange character in chrome's resource css viewer?
  • IE6 changes DOCTYPE to a bad one
  • Time out Error in send mail
  • Plotting densities in R
  • Doctrine/Symfony entity generator and generating entity from one table
  • Getting the scrolling offset when storing coordinates
  • How can I tell a form not to dispose a particular control when it closes?
  • Update Google Maps traffic layer without page reloading
  • SonarQube: Cannot deactivate rule with missing quality profile
  • Default parameter as generic type
  • Installing iPhone App to iPhone
  • Listbox within Listbox and scrolling trouble in Windows Phone 7 Silverlight
  • Disable Enter in editText android
  • AES padding and writing the ciphertext to a disk file
  • How to convert from System.Drawing.Color to Excel.ColorFormat in C#? Change comment color
  • Why doesn't :active or :focus work on text links in webkit? (safari & chrome)
  • How to check if every primary key value is being referenced as foreign key in another table
  • Validaiting emails with Net.Mail MailAddress
  • MySQL WHERE-condition in procedure ignored
  • Trying to switch camera back to front but getting exception
  • Web-crawler for facebook in python
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • trying to dynamically update Highchart column chart but series undefined
  • Benchmarking RAM performance - UWP and C#
  • python regex in pyparsing
  • Acquiring multiple attributes from .xml file in c#
  • JTable with a ScrollPane misbehaving
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • java string with new operator and a literal