html – Como faço para adicionar uma thumb ao meu site?

como eu faço para adicionar uma thumbnail ao meu site em html, tipo, assim que eu digitar sua url no facebook por exemplo ele mostraria uma imagem clicavel, da mesma forma como fica se vocês digitarem o endereço do google (mostra tipo um banner do google).

Espero que possam me ajudar

javascript – How to parse a HTML template from Json and populate the data

I have a requirement to show an HTML template served from a JSON API, with custom tags on it. Those custom tags should be populated with another JSON object. Please help.

I’m able to populate the HTML in the page, but not able to bind the custom variable with a JSON value in it.

Eg:

import React, {  useEffect, useState } from 'react';
import axios from 'axios';
import ReactHtmlParser from 'react-html-parser';
const DynamicContainer = () => {
const (result, setResult) = useState(());
let HTML3='';
let title = '';
  useEffect(  () => {
    axios.get(` http://localhost:3000/data`)
    .then(res => {
      setResult({
        jsonContent:res.jsonContent,
        jsonHtml:res.jsonHtml
      })
      })
      .catch(error => {
        console.log(error);
        setResult({error})
      });
  }, ());

  if(result !=""){
    title = result.jsonContent.title
    HTML1 =  result.jsonHtml;
  }
  return (
    <div>
        {ReactHtmlParser(HTML1)}
    </div>

  //<div className="" dangerouslySetInnerHTML={{ __html: result.jsonHtml}}></div>
  )
}
export default DynamicContainer;

// JSON format (
somewhat similar to this JSON format, having an HTML template and a JSON value
This is in my local, in production, there would be 2 APIs serving HTML and JSON.
) :

{
  (
    "jsonHTMl":{
      "<div class="card "><h1>${title}</h1></div>"
    },
    "jsonContent": {
      "title": "Hello World"
    }
  )
}

html – ¿Cómo insertar una imagen en el medio de un texto sin tapar su contenido y manteniendo márgenes adecuados?

Estoy aprendiendo HTML y CSS de manera autodidacta, siguiendo y aplicando lecciones de internet, así como ésta.

Estoy intentando centrar una imagen en medio de un texto, aplicando una regla CSS, pero me arroja los siguientes problemas:

  • Interrumpe el texto en el sitio exacto donde la pongo.
  • No mantiene espacios izq. derecho, arriba, abajo, afectando su elegancia y quedando pegado al texto.
  • En lugar de intercalarse “en” el texto, se interpuso “sobre” el texto tapándolo.

Quisiera sus buenos oficios para mejorar el código que seguidamente expongo, y que igual que yo, otros lectores sabrán darle la utilidad que corresponde. De antemano gracias. Anexo código y texto simulado.

node.js – Inject content into html served by nodejs expressjs

I have an Express server. It serves a static HTML file that uses Vue.

I don’t want to render the HTML in NodeJS (e.g., using Pug), Vue already renders it on the client side and spares my server’s resources. But it requires some dynamic data. Instead of polling the server for this data after the DOM is loaded, I’m injecting it into the HTML file in NodeJS:

const htmlFile = await fs.promises.readFile('htmlFile', 'utf8'),
    myData = (object1, object2, object3, etc),
    // Try to sanitize my data only by replacing <>
    myDataLazilySanitized = (JSON.stringify(myData)).replace(/(<>)/g, (char) => char === '<' ? '&lt;' : '&gt;');

// I now add myData to a custom element, right after the <body> tag
res.send(htmlFile.replace(/<body>/i, '<body><x-server-data id="x-server-data" class="hidden">' + myDataLazilySanitized + '</x-server-data>'));

Nothing in myData has < or >, so I can safely replace them for HTML entities.

The browser then parses this data:

myData = JSON.parse(document.getElementById('x-server-data').innerHTML);

I have 2 questions:

  • Is it safe what I’m doing? (i.e., is this lazy sanitizing enough)
  • Is there an easier way to do this?

Realted:
https://stackoverflow.com/questions/58264703/nodejs-how-to-insert-an-element-in-a-html-document-using-javascript

Convert Big WordPress Website into Static HTML Files

How can i do that, and deploy it to Fireb… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1834936&goto=newpost

master page – How to add an overridable meta tag to a SharePoint 2013 html masterpage?

In SP2013, I have a master page (.html/.master) file that I want specific pages that use this master page to have the ability for devs to override a specific meta tag. Specifically this one

<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />

By default it comes with

<meta http-equiv="X-UA-Compatible" content="IE=10" />

But is there a way I can wrap this or move this into an asp tag that I can then override at a page level or page layout level?

I see this in the .html master page file

    <!--MS:<SharePoint:AjaxDelta id="DeltaPlaceHolderAdditionalPageHead" Container="false" runat="server">-->
        <!--MS:<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">-->
        <!--ME:</asp:ContentPlaceHolder>-->
        <!--MS:<SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true">-->
        <!--ME:</SharePoint:DelegateControl>-->
        <!--MS:<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server">-->
        <!--ME:</asp:ContentPlaceHolder>-->
    <!--ME:</SharePoint:AjaxDelta>-->

Is there a way to put it into here, such that I can override it at a page level?

Thanks

html – How to Make Un-bold in Selected Nodes in contenteditable Div?

I have a ContentEditable Div that User can Change format of Texts Like simple Editor.
I can Use extractContent to get selected Nodes. When User make Bold some part of this text, Its easy to wrap all texts (maybe nodes) with <b> and </b>. but when user select some text (maybe nodes) inside this part, I can’t make this part un-bold. let me show in Algorithm:

  1. user type : I am Developer (Text : I am Developer)(Html : I am Developer)
  2. user select and make bold part of this text : I am Developer (Text : I am Developer)(Html : I a<b>m Develop</b>er)
  3. user select some part of bolded text and make it un-bold : I am Developer (Text : I am Developer)(Html : I a<b>m D</b>eve<b>lop</b>er)

Step 1 is easy.
step 2 has a simple solution. I use Range() in javascript and get all selected Nodes. Wrap all Nodes with <b> and </b> .
step 3 is difficult. I can use Range() in javascript to get all selected Nodes but there is no special tag to wrap this content , so the affection of parent <b> exist yet. I dont want to use some classes to make ineffective <b>.
I dont know How to get html part of this selection, change it then insert at the same point.
Range() has InsertNode but it is for node NOT string.
Real Question : How should I make some child node of parent un-bold while parent is bold and preserve other child bold too?
Javascript or jquery, No different.

Update

for <b> tag I can wrap all text nodes with <b>. I dont want to do this.

How do I change the font of my html text?

I’m in trouble because I want to change the font of my text contained in Send me updates and I don’t know how to do it I have already put it in several ways but I can’t find a solution I would be grateful if you answered me despite being something basic I don’t understand. This is the code

<!doctype html>

Send me updates

Sign up

Can Bluehost or Byethehost be used to upload any HTML 5 or other games I make?

If yes the for Bluehost and also Bythehost (or however it is spelled) how do I Jason upload a game I made? Thank you very much in advance…. | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1834727&goto=newpost

php – How to change WooCommerce loop product title HTML output in single product page and archive page

I’m currently working on designing my custom WooCommerce theme and wondering how I could change the HTML output of loop_product_title in single product page and in archive pages.

I have less knowledge of functions but I made this content but it did not work. I just want the loop product title to have element and in archives pages to have .

if ( is_product() ){
function woocommerce_template_loop_product_title() {
echo '<h2 class="product-title">' . get_the_title() . '</h3>';
}
elseif ( is_shop() ){
function woocommerce_template_loop_product_title() {
echo '<span class="product-title">' . get_the_title() . '</span>';
}
}
}

Please someone help me out. I have tried the best of what I could.