English 中文(简体)
我如何使我的统一编码涵盖母体的全面宽度和高度?
原标题:How do I make my unicode within span encompass full width and height of parent?
  • 时间:2019-09-12 22:06:34
  •  标签:
  • css
  • unicode

基本上,当我发布新闻时,我想到的冰景似乎覆盖了整个宽度和高度。 我也希望这一跨段元素能够占其母集装箱的100%,其类别名称为“冰”。

这里是我的联合材料:

const btn=document.querySelector("button")
const player=document.querySelectorAll( .player )


player.forEach(player=> {
  diceDiv=document.createElement("div")
  span=document.createElement("span")
  player.appendChild(diceDiv)
  diceDiv.appendChild(span)
})



const diceRoll=(span)=> {
  let numOfDots = Math.floor(Math.random() * 6) + 1  
  span.innerHTML= &#9856 
}


btn.addEventListener( click , ()=> {
  player.forEach(player=> player.firstElementChild.classList.add("dice"))
  const spans=document.querySelectorAll( span )
  spans.forEach(span=> {
    diceRoll(span)
  })
}) 

然而,我试图这样做,单条形冰面仍然出现在我四分五裂的底层。 为什么如此?

问题回答

I hope the main purpose of this game is JS and not CSS, After playing with your fiddle, If you add following properties to your span element, it would take the space of parent div i.e "dice"

display: inline-block;
font-size: 202px;
margin-top: -72px;




相关问题
Why are there duplicate characters in Unicode?

I can see some duplicate characters in Unicode. For example, the character C can be represented by the code points U+0043 and U+0421. Why is this so?

how to extract characters from a Korean string in VBA

Need to extract the initial character from a Korean word in MS-Excel and MS-Access. When I use Left("한글",1) it will return the first syllable i.e 한, what I need is the initial character i.e ㅎ . Is ...

File open error by using codec utf-8 in python

I execute following code on windows xp and python 2.6.4 But it show IOError. How to open file whose name has utf-8 codec. >>> open( unicode( 한글.txt , euc-kr ).encode( utf-8 ) ) Traceback ...

UnicodeEncodeError on MySQL insert in Python

I used lxml to parse some web page as below: >>> doc = lxml.html.fromstring(htmldata) >>> element in doc.cssselect(sometag)[0] >>> text = element.text_content() >>>...

Fast way to filter illegal xml unicode chars in python?

The XML specification lists a bunch of Unicode characters that are either illegal or "discouraged". Given a string, how can I remove all illegal characters from it? I came up with the following ...

热门标签