html

How to center align two divs having a parent div

不羁岁月 提交于 2021-02-19 08:43:09
问题 If I am having two divs in a parent div and and all three divs have float left. What I have to do is to align center the two child divs without removing float left. 回答1: Use display: inline-block instead of float: left on child divs and you can give text-align: center to the parent div. 回答2: Let me see if i have understood,so you have something like this: <div id="parent" style="float:left;"> <div id="child1" style="float:left;"></div> <div id="child2" style="float:left;"></div> </div> And if

How to loop with *ngFor in array of objects?

≡放荡痞女 提交于 2021-02-19 08:42:30
问题 I'm learning Angular2, so please forgive me if I'm asking a stupid question. I am receiving an arrays of objects and it looks like this: obj.json data: [ { item: "banana" } ], [ { item: "apple" } ], [ { item: "lemon" } ] In my component file I have managed to scope it in a scope: this.fruits = data[0].item; The issue is I only manage to scope the first item, or the second item and so on, by the index. How can I scope them all and then show them in a HTML file with *ngFor ? 回答1: Your array isn

Images not displaying html <img />

浪尽此生 提交于 2021-02-19 08:39:27
问题 I have been at this for hours trying to get these images to display. I didn't want to resort to posting a question on stackoverflow but it seems like the best option right now. I have read a several posts on stackoverflow and even a couple others on different sites. I have tried out everything suggested and I don't seem to be spotting any obvious errors with my eyes by looking at my code. I am making a personal website for myself and I am making image links to my blogger, twitter, linkedin

Camera and video control with HTML5 form android webview

左心房为你撑大大i 提交于 2021-02-19 08:37:05
问题 I use this guide : Camera and video control with HTML5 This example work excellent on Google Chrome but i can not make it work on Android webview. I also use permission : android.permission.CAMERA. 回答1: Did you remember to add this to your onCreate WebSettings webSettings = myWebView.getSettings(); webSettings.setJavaScriptEnabled(true); webSettings.setAllowFileAccessFromFileURLs(true); webSettings.setAllowUniversalAccessFromFileURLs(true); You are probably missing the last two lines in your

How to Autostart Youtube VIDEO with Low Volume (iframe)

二次信任 提交于 2021-02-19 08:35:08
问题 This is the iframe I create to autostart a video (music, mostly) in my blog : < iframe width="140" height="105" src="https://www.youtube.com/embed/tGzl_AB4poI?rel=0&showinfo=0&autoplay=1" frameborder="0" allowfullscreen></iframe> It's all perfect. The only problem is the Audio, because the Volume is too high and I would decrease it- So I added this part on my code : "&player.setVolume(5)" The final code, then, is this one: < iframe width="140" height="105" src="https://www.youtube.com/embed

Zoom on an area of a image map

寵の児 提交于 2021-02-19 08:24:09
问题 I'm currently trying to make a responsive image map where we can also zoom on specific areas. For the moment I have something like that (illustration): I have for example 3 sections for 3 different area but now what I wan't is to zoom in a specific area when the user click on it. I already tried a few jquery script but the problem is that it zoom everything and the area don't resize by themselves (but when we reduce the window, it does). I would like something like that: http://preview

How to pass an object as function's parameter without getting Unexpected identifier error?

你说的曾经没有我的故事 提交于 2021-02-19 08:21:43
问题 I tried to passed the object as parameter in function getReqDetail but it returned Uncaught SyntaxError: Unexpected identifier. But when i passed a simple value(integer,boolean,string) as parameter such as data[i].id, it worked. So how do i passed the object as parameter the data/object is from ajax function jquery function agetAllRequests(){ $.ajax({ type: 'GET', url: `http://localhost:8080/api/requests`, headers: { "Content-Type": "application/json", "Accept": "application/json" }, dataType

Format date within an echo

…衆ロ難τιáo~ 提交于 2021-02-19 08:21:33
问题 I'm trying to format a MySQL formatted date (YYYY-MM-DD) and wish to display the month and year, "September 2012" for example. My code: <?php echo htmlspecialchars($row["date"], ENT_QUOTES, "UTF-8"); ?> Does anyone know how I can accomplish this? 回答1: You can use DateTime to format your date how you'd like: $date = DateTime::createFromFormat('Y-m-d', $row["date"]); echo htmlspecialchars($date->format('F Y'), ENT_QUOTES, "UTF-8"); So with a date like this: $row['date'] = '2012-09-25'; This

How can I add a generic page header with site navigation to an asciidoc document?

为君一笑 提交于 2021-02-19 08:20:40
问题 I'm trying to build a basic documentation site using asciidoctor. One thing I am struggling with is how I can inject a standard site header (a banner with a logo and top-level navigation) into each documentation page. I render my asciidoc directly to html from the command line. I have tried to find a way to somehow inject an extra div element and position it fixed at the top, but I can't figure out what mechanism to use for this. My early attempts involved using docinfo.html but that gets

page-break not working in html-pdf coverter in nodejs

纵饮孤独 提交于 2021-02-19 08:18:05
问题 I am using html-pdf 2.2.0 module to convert my html in pdf. I am using table with multiple rows so I want to use page-break so then a single row does not divide in two pages but its not working when converting it to pdf. Below is the code sample <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <style> table tbody tr { height