Dog rates social card with SVG background
Social card with a fun SVG background and highlighted text.
Explore exampleSimple social card example showing highlighted yellow text

Interactive example
Change the HTML, CSS, or API options. The browser preview updates as you edit; select Image to render the final output through the API.
Example code
Choose a language and copy a complete request using this example's HTML, CSS, and API options.
// dotnet add package HtmlCssToImage
using HtmlCssToImage;
using HtmlCssToImage.Models;
using HtmlCssToImage.Models.Requests;
using System.Collections.Generic;
using System.Text.Json.Nodes;
// In an application, use IHttpClientFactory through dependency injection:
// https://www.nuget.org/packages/HtmlCssToImage.DependencyInjection
using var httpClient = new HttpClient();
var client = new HtmlCssToImageClient(
httpClient,
new HtmlCssToImageOptions(
Environment.GetEnvironmentVariable("HCTI_API_ID")!,
Environment.GetEnvironmentVariable("HCTI_API_KEY")!));
var request = new CreateHtmlCssImageRequest
{
Html = """
<div class="p-4 text-center mt-4" style="width: 500px">
<span class="tweet-text mb-4">
This is Little Bear. He tolerates baths because he knows how phenomenal his
floof will appear afterwards. 13/10
</span>
<div class="mt-2 p-4">
<img src="https://docs.htmlcsstoimage.com/assets/images/dog.jpg" class="rounded-circle shadow border mt-4" width="100px">
</div>
<h4 class="mt-2">
WeRateDogs
</h4>
<span class="text-muted">@dog_rates</span>
</div>
<!-- Include external CSS, JavaScript or Fonts! -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@700" rel="stylesheet">
""",
Css = """
.tweet-text {
background-color: #fff2ac;
background-image: linear-gradient(to right, #ffe359 0%, #fff2ac 100%);
font-weight: bolder;
font-size: 32px;
font-family: 'Roboto', sans-serif;
padding: 4px;
}
""",
};
using var result = await client.CreateImageAsync(request);
if (result.Success && result.Response is not null)
{
Console.WriteLine(result.Response.Url);
}
From code to screenshot
HTML/CSS to Image renders HTML and CSS in hosted Chrome, then captures the result as an image or PDF. Each example combines real source code with the API options used for the render, so it is both a working demo and a starting point for your own request.
Edit the source and options above to test changes in the browser, then render through the API to see the production result.
Yes. Open an example to inspect and edit its complete HTML, CSS, and render options. Use it as a starting point, then send the resulting request from your application.
Examples are complete API requests built from HTML and CSS. Templates are saved, reusable designs created in the visual editor and rendered repeatedly with different variable values.
Yes. HCTI can render HTML and CSS or capture a public webpage as an image, and it can generate PDFs when you need document output instead of a screenshot.
Send the example’s HTML, CSS, and request options from your application.
Use HCTI with MCP-enabled AI tools, Zapier, Make, and other automation platforms.
Start with a visual preset, customize it in the template editor, and render it repeatedly with dynamic values.
Keep exploring
Social card with a fun SVG background and highlighted text.
Explore example