javascript - dir=auto attribute is not working when applied to div tag -
i have applied dir=auto attribute <div> element in order text alignment based on input language. if <p> tag present inside <div> dir=auto attribute not working <p> tag. again have apply dir attribute p tag also.
is there behavior difference when both div , p tags present?.
<div id="editbox" dir=auto contenteditable="true" style="margin: 5px; overflow-y: scroll; overflow-x: scroll;"> <p style="margin-top:0;margin-bottom:0;"><br></p> </div> i testing in android emulator.
can apply dir attribute body element, take care of text alignment based on input language?
the attribute dir=auto (an html5 novelty limited support) sets directionality of element according first characters strong directionality. not try analyze language of text @ all.
the way make element’s directionality depend on own content in sense set dir attribute value auto on element itself. cannot make attribute inherited.
but can use javascript traverse element , set dir property "auto" desired descendants.
Comments
Post a Comment