Rookie question break line

Posted In HTML & CSS
  • christopher-orloff 6 days ago
    Hi I need some help with my code. It need to be on two lines insted of one long
    
    It needs to stay like this
    TEXT1
    TEXT2
    
    And not like this.
    TEXT1 TEXT2 
    
    
    
    container.append("text")
                .attr("x", 0)
                .attr("y", 15)
                .attr("text-anchor", "middle")
                .text("TEXT1 TEXT2")
                .style({"font-weight":"bold", "font-size":"20px"});
    
    Kind regards Christopher

    Hi I need some help with my code. It need to be on two lines insted of one long

    It needs to stay like this TEXT1 TEXT2

    And not like this. TEXT1 TEXT2

    container.append("text") .attr("x", 0) .attr("y", 15) .attr("text-anchor", "middle") .text("TEXT1 TEXT2") .style({"font-weight":"bold", "font-size":"20px"});

    Kind regards Christopher

  • mark 4 days ago
    Try one of those 2:
    
    ```
    container.append("text") .attr("x", 0) .attr("y", 15) .attr("text-anchor", "middle") .text("TEXT1 \n TEXT2") .style({"font-weight":"bold", "font-size":"20px"});
    ```
    
    ```
    container.append("text") .attr("x", 0) .attr("y", 15) .attr("text-anchor", "middle") .html("TEXT1 <br /> TEXT2") .style({"font-weight":"bold", "font-size":"20px"});
    ```

    Try one of those 2:

    container.append("text") .attr("x", 0) .attr("y", 15) .attr("text-anchor", "middle") .text("TEXT1 \n TEXT2") .style({"font-weight":"bold", "font-size":"20px"});
    
    container.append("text") .attr("x", 0) .attr("y", 15) .attr("text-anchor", "middle") .html("TEXT1 <br /> TEXT2") .style({"font-weight":"bold", "font-size":"20px"});
    
  • christopher-orloff 4 days ago
    Hi just tried. 
    Non of them worked :( 
    
    But endend up with a not so pretty solution :D 
    
           container.append("text")
                .attr("x", 0)
                .attr("y", 0)
                .attr("text-anchor", "middle")
                .text("TEXT1")
                .style({"font-weight":"bold", "font-size":"20px"});
            
            container.append("text")
                .attr("x", 0)
                .attr("y", 25)
                .attr("text-anchor", "middle")
                .text("TEXT2")
                .style({"font-weight":"bold", "font-size":"20px"});

    Hi just tried. Non of them worked :(

    But endend up with a not so pretty solution :D

       container.append("text")
            .attr("x", 0)
            .attr("y", 0)
            .attr("text-anchor", "middle")
            .text("TEXT1")
            .style({"font-weight":"bold", "font-size":"20px"});
        
        container.append("text")
            .attr("x", 0)
            .attr("y", 25)
            .attr("text-anchor", "middle")
            .text("TEXT2")
            .style({"font-weight":"bold", "font-size":"20px"});
    
  • eliot-elioy 2 days ago
    None of them worked for me..
    
    <a href="https://speedtest.vet/">speed test</a>

    None of them worked for me..

    speed test

Please login or signup to leave a response.

Login

or Sign Up

Sign Up

or Login
×
Want to create your own SAAS?

I can teach you to create your own Software as a Service. Click here to learn more!

Visit SAAS Adventure!